math.sin
Calculate the sine of an angle.
Python 3.13
math.sin(x)- x
- The angle in radians.int | float
Return value
A float from -1 to 1.
Examples
Sine of a right angle
Python 3.13
import math
print(math.sin(math.pi / 2))1.0
Sine of an angle in degrees
Python 3.13
import math
print(round(math.sin(math.radians(30)), 2))0.5
Details
Convert an angle in degrees with math.radians first. The result is approximate: math.sin(math.pi) gives 1.2246467991473532e-16, not 0.
