Describe
sin () returns the sinusoidal value of the X-arc.
Grammar
The following is the syntax for the Sin () method:
Import Mathmath.sin (x)
Note:sin () is not directly accessible, you need to import the math module, and then call the method through the math static object.
Parameters
return value
Returns the sine of the x radians, with a value between 1 and 1.
Instance
The following shows an example of using the sin () method:
#!/usr/bin/python3import mathprint ("Sin (3):", Math.sin (3)) Print ("Sin ( -3):", Math.sin ( -3)) print ("Sin (0): ", Math.sin (0)) print (" Sin (Math.PI): ", Math.sin (Math.PI)) print (" Sin (MATH.PI/2): ", Math.sin (math.pi/ 2))
When the above instance is run, the output is:
Sin (3): 0.1411200080598672sin ( -3): -0.1411200080598672sin (0): 0.0sin (Math.PI): 1.2246467991473532e-16sin (MATH.PI/2): 1.0
Python sin () function