# sin()

sin(x) returns sin x. Input number is in radian
``````import math
print(math.sin(1))       # 0.8414709848078965
print(math.sin(0.56))    # 0.5311861979208834
print(math.sin(-0.56))   # -0.5311861979208834
print(math.sin(-1))      # -0.8414709848078965
print(math.sin(0))       # 0.0
print(math.sin(math.pi)) # 1.2246467991473532e-16``````
Note that all the inputs are in radian.

## Inputs in degree

We can convert radian value to degree and use the same
``````import math
in_degree = 90
print(math.sin(in_redian))     # 1.0``````

## Drawing graph of sin()

Using this we will use Matplotlib to generate graph of sin
``````import matplotlib.pyplot as plt
x=[]
y=[]
i=0
while (i<=8):
x.append(i)
y.append(math.sin(i))
i=i+0.1
plt.plot(x,y)
plt.axvline(x=0.00,linewidth=2, color='#f1f1f1')
plt.axhline(y=0.00,linewidth=2, color='#f1f1f1')
plt.grid(linestyle='-', linewidth=0.5,color='#f1f1f1')
plt.show()``````

Subscribe to our YouTube Channel here

## Subscribe

* indicates required
Subscribe to plus2net

plus2net.com