Copyright © tutorialspoint.com
This function converts angle x from degrees to radians.
radians(x) |
Note: This function is not accessible directly so we need to import math module and then we need to call this function using math static object.
Here is the detail of parameters:
x: Must be a numeric value
The radian value of an angle.
#!/usr/bin/python import math print "radians(3) : ", math.radians(3) print "radians(-3) : ", math.radians(-3) print "radians(0) : ", math.radians(0) print "radians(math.pi) : ", math.radians(math.pi) print "radians(math.pi/2) : ", math.radians(math.pi/2) print "radians(math.pi/4) : ", math.radians(math.pi/4) |
This will produce following result:
radians(3) : 0.0523598775598 radians(-3) : -0.0523598775598 radians(0) : 0.0 radians(math.pi) : 0.0548311355616 radians(math.pi/2) : 0.0274155677808 radians(math.pi/4) : 0.0137077838904 |
Copyright © tutorialspoint.com