Home >>Python math Module >Python math.atan2() Method
Python math.atan2() Methodis used to get the arc tangent value of y/x and it accepts two numbers (return is between PI and -PI) and returns arc tangent.
Syntax:math.atan2(y,x)
Parameter | Description |
---|---|
y | It is Required and specifies the dividend |
x | It is Required and specifies the divisor |
import math
print (math.atan2(3, 9))
print (math.atan2(17, 5))
print (math.atan2(13, -2))
import math
x = -1
y = 1
print("atan2(",x,",",y,") is = ", math.atan2(x,y))
x = 0.1674
y = 1.895
print("atan2(",x,",",y,") is = ", math.atan2(x,y))
x = -2
y = 2
print("atan2(",x,",",y,") is = ", math.atan2(x,y))
x = 5
y = 34.12
print("atan2(",x,",",y,") is = ", math.atan2(x,y))