math.sin
Defined in module
"math"from "math" import sinReturns the sine of x (in radians)
Parameters
x | number | angle 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
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)) = floatSee also
cos | Returns the cosine of x (in radians) |
tan | Returns the tangent of x (in radians) |
asin | Returns the arcsine of x |
PI | The ratio of a circle's circumference to its diameter, for converting between radians and degrees and for angle math in general. |
| math | module index |