SIN
Source: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgSin Last revised: 2018-04-16
Returns the sine of an angle.
Syntax
declare function Sin ( byval angle as double ) as doubleUsage:
result = Sin( angle )Parameters
- angle — The angle, in radians.
Return Value
Returns the sine of angle as a Double in the range -1.0 to 1.0.
Description
The argument angle is measured in radians (not degrees).
The value returned by this function is undefined for values of angle with an absolute value of 2^63 or greater.
Sin can be overloaded as an operator to accept user-defined types.
Examples
vb
Const PI As Double = 3.1415926535897932
Dim a As Double
Dim r As Double
Input "Please enter an angle in degrees: ", a
r = a * PI / 180 'Convert the degrees to Radians
Print ""
Print "The sine of a" ; a; " degree angle is"; Sin ( r )
SleepOutput:
Please enter an angle in degrees: 30
The sine of a 30 degree angle Is 0.5Differences from QB
- None.