python tutorial - Trigonometry | Mathematical Functions in Python | Trigonometric and Angular Functions - learn python - python programming




1. sin() :- This function returns the sine of value passed as argument. The value passed in this function should be in radians.

2. cos() :- This function returns the cosine of value passed as argument. The value passed in this function should be in radians.

python - Sample - python code :

# Python code to demonstrate the working of
# sin() and cos()
  
# importing "math" for mathematical operations
import math
 
a = math.pi/6
  
# returning the value of sine of pi/6
print ("The value of sine of pi/6 is : ", end="")
print (math.sin(a))
  
# returning the value of cosine of pi/6
print ("The value of cosine of pi/6 is : ", end="")
print (math.cos(a))

python tutorial - Output :

The value of sine of pi/6 is : 0.49999999999999994
The value of cosine of pi/6 is : 0.8660254037844387

3. tan() :- This function returns the tangent of value passed as argument. The value passed in this function should be in radians.

4. hypot(a, b) :- This returns the hypotenuse of the values passed in arguments. Numerically, it returns the value of sqrt(a*a + b*b).

python - Sample - python code :

# Python code to demonstrate the working of
# tan() and hypot()
  
# importing "math" for mathematical operations
import math
 
a = math.pi/6
b = 3
c = 4
  
# returning the value of tangent of pi/6
print ("The value of tangent of pi/6 is : ", end="")
print (math.tan(a))
  
# returning the value of hypotenuse of 3 and 4
print ("The value of hypotenuse of 3 and 4 is : ", end="")
print (math.hypot(b,c))

python tutorial - Output :

The value of tangent of pi/6 is : 0.5773502691896257
The value of hypotenuse of 3 and 4 is : 5.0

5. degrees() :- This function is used to convert argument value from radians to degrees.

6. radians() :- This function is used to convert argument value from degrees to radians.

python - Sample - python code :

# Python code to demonstrate the working of
# degrees() and radians()
  
# importing "math" for mathematical operations
import math
  
a = math.pi/6
b = 30
 
# returning the converted value from radians to degrees
print ("The converted value from radians to degrees is : ", end="")
print (math.degrees(a))
  
# returning the converted value from degrees to radians
print ("The converted value from degrees to radians is : ", end="")
print (math.radians(b))

Output:

The converted value from radians to degrees is : 29.999999999999996
The converted value from degrees to radians is : 0.5235987755982988

Wikitechy tutorial site provides you all the learn python , online python programming course python programming class online , python coding for dummies , python programming classes online , online training python , online python training , python programming online course , python training classes

Related Searches to Mathematical Functions in Python | Trigonometric and Angular Functions

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add wikitechy.com to your ad blocking whitelist or disable your adblocking software.

×