YouTip LogoYouTip

Python3 Func Number Atan2

# Python3.x Python3 atan2() Function [![Image 3: Python3 Numbers](#) Python3 Numbers](#) * * * ## Description **atan2()** returns the arctangent of the given X and Y coordinate values. * * * ## Syntax Here is the syntax for the atan2() method: import math math.atan2(y, x) **Note:** atan2() cannot be accessed directly; you need to import the math module and then call the method via the math static object. * * * ## Parameters * x -- A numeric value. * y -- A numeric value. * * * ## Return Value Returns the arctangent of the given X and Y coordinate values. * * * ## Example The following example demonstrates the use of the atan2() method: #!/usr/bin/python3import math print ("atan2(-0.50,-0.50) : ", math.atan2(-0.50,-0.50))print ("atan2(0.50,0.50) : ", math.atan2(0.50,0.50))print ("atan2(5,5) : ", math.atan2(5,5))print ("atan2(-10,10) : ", math.atan2(-10,10))print ("atan2(10,20) : ", math.atan2(10,20)) The output of the above example is: atan2(-0.50,-0.50) : -2.356194490192345 atan2(0.50,0.50) : 0.7853981633974483 atan2(5,5) : 0.7853981633974483 atan2(-10,10) : -0.7853981633974483 atan2(10,20) : 0.4636476090008061 [![Image 4: Python3 Numbers](#) Python3 Numbers](#)
← Python3 Func Number HypotPython3 Func Number Atan2 β†’