math.cos
Defined in module
"math"from "math" import cosReturns the cosine of x (in radians)
Parameters
x | number | angle in radians |
Return value
The cosine 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 cos, PI
println("cos(0) =", cos(0))
println("cos(PI/3) =", cos(PI/3))
println("cos(PI) =", cos(PI))Output:
cos(0) = 1
cos(PI/3) = 0.5
cos(PI) = -1See also
sin | Returns the sine of x (in radians) |
tan | Returns the tangent of x (in radians) |
acos | Returns the arccosine 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 |