Quirrel4.41.0

math.sin

Defined in module "math"
from "math" import sin
pure fastcall sin(x: number): float

Returns the sine of x (in radians)

Parameters

xnumberangle in radians

Return value

The sine of x, always as a float.

Notes

x is defined for any real number; there is no restricted domain to worry about, unlike asin and acos.

Example

examples/math/sin.nut
from "math" import sin, PI

println("sin(0) =", sin(0))
println("sin(PI/6) =", sin(PI/6))
println("sin(PI/2) =", sin(PI/2))

// the argument is converted to float, even when it is an integer
println("type(sin(0)) =", type(sin(0)))
Output:
sin(0) = 0
sin(PI/6) = 0.5
sin(PI/2) = 1
type(sin(0)) = float

See also

cosReturns the cosine of x (in radians)
tanReturns the tangent of x (in radians)
asinReturns the arcsine of x
PIThe ratio of a circle's circumference to its diameter, for converting between radians and degrees and for angle math in general.
mathmodule index