Tutorials Point


  Python Basics
  Python Advanced
  Python Useful References
  Python Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

Python Number radians() Function


previous next AddThis Social Bookmark Button


Description:

This function converts angle x from degrees to radians.

Syntax:

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.

Parameters:

Here is the detail of parameters:

  • x: Must be a numeric value

Return Value:

The radian value of an angle.

Example:

#!/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


previous next Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names