sin() math function in python by R4R Team

- sin() is python math function which determine the sine value of number.

Syntax-

math.sin(x)

- Here x should be a numeric value.
- it return the sine value of x in radians.

Example-

sin(90) will return 0.8939966636005579
sin(0) will 0


program-

import math

#these value are in radians
print("sin(90) : ",math.sin(90))
print("sin(0) : ",math.sin(0))
print("sin(45) : ",math.sin(45))
print("sin(60) : ",math.sin(60))
print("sin(10) : ",math.sin(10))


output-

sin(90) : 0.8939966636005579
sin(45) : 0.0
sin(0) : 0.8509035245341184
sin(30) : -0.3048106211022167
sin(10) : -0.5440211108893698


-If we want to print the sine value of x, consider x should be in degree then


program-

import math

#these value are in degree
n=math.pi/180
print("sin(90) : ",math.sin(90*n))
print("sin(0) : ",math.sin(0*n))
print("sin(45) : ",math.sin(45*n))
print("sin(30) : ",math.sin(30*n))
print("sin(60) : ,",math.sin(60*n))
print("sin(10) : ,",math.sin(10*n))


output-

sin(90) : 1.0
sin(0) : 0.0
sin(45) : 0.7071067811865476
sin(30) : 0.49999999999999994
sin(60) : , 0.8660254037844386
sin(10) : , 0.17364817766693033




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!