The math.atan2() function returns the arc tangent (inverse tangent) of a ratio of two values, y
and x.
math.atan2(y, x)
Where y
is the numerator and x
is the denominator of the ratio whose arc tangent we want. The function evaluates and returns the inverse tangent of y/x
in radians.
The math.degrees function, as shown above, converts an angle from radians to degrees.