math.atan2()
math.atan2() is a Python function in the Math Module category. Returns the arc tangent of y/x in radians, using signs of both to determine quadrant. The syntax is math.atan2(y, x). Returns: Float. A typical example: math.atan2(1, 1) # 0.7853981633974483
math.atan2(-1, -1) # -2.356194490192345. A close sibling is math.ceil(), which returns the smallest integer greater than or equal to x. A close sibling is math.floor(), which returns the largest integer less than or equal to x. A close sibling is math.trunc(), which truncates the fractional part, returning the integer part. A close sibling is math.fabs(), which returns the absolute value of x as a float. More about this category: Mathematical functions — sin, cos, sqrt, floor, ceil, and constants. For a broader walkthrough, read the Math Module guide. Related Math Module entries: math.ceil(), math.floor(), math.trunc(), math.fabs(), math.sqrt(), math.pow(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details.