Python Tutorial Python Advanced Python References Python Libraries

Python math - sin() Function



The Python math.sin() function returns trigonometric sine of an angle (angle should be in radians). In the graph below, sin(x) vs x is plotted.

Sin Function

Syntax

math.sin(x)

Parameters

x Required. Specify the angle in radian.

Return Value

Returns the trigonometric sine of an angle.

Example:

In the example below, sin() function is used to find out the trigonometric sine of an angle.

import math

pi = math.pi
print(math.sin(pi/6))
print(math.sin(pi/4))
print(math.sin(pi/3))

The output of the above code will be:

0.49999999999999994
0.7071067811865475
0.8660254037844386

❮ Python Math Module

5