xHarbour Reference Documentation > Function Reference |
Calculates the sine.
Sin( <nAngle> ) --> nSine
The function returns the sine of an angle in the range between -1 and +1.
See also: | Cos(), Cot(), DtoR(), RtoD(), SinH(), Tan() |
Category: | CT:Math , Mathematical functions , Trigonometric functions |
Source: | ct\trig.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example displays results of function Sin(). PROCEDURE Main ? Str( Sin( -Pi()*1.0 ), 18, 15) // result: 0.000000000000000 ? Str( Sin( -Pi()*0.5 ), 18, 15) // result: -1.000000000000000 ? Str( Sin( -Pi()*0.3 ), 18, 15) // result: -0.809016994374948 ? Str( Sin( Pi()*0.0 ), 18, 15) // result: 0.000000000000000 ? Str( Sin( Pi()*0.3 ), 18, 15) // result: 0.809016994374948 ? Str( Sin( Pi()*0.5 ), 18, 15) // result: 1.000000000000000 ? Str( Sin( Pi()*1.0 ), 18, 15) // result: 0.000000000000000 RETURN
http://www.xHarbour.com