@nevware21/ts-utils
    Preparing search index...

    Function mathAtan2

    The mathAtan2() function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0,0) to the point (x,y).

    0.12.0

    The y coordinate

    The x coordinate

    The arctangent of the quotient of the arguments

    mathAtan2(1, 1); // 0.7853981633974483 (approximately π/4)
    mathAtan2(1, 0); // 1.5707963267948966 (π/2)
    mathAtan2(0, 1); // 0
    mathAtan2(-1, -1); // -2.356194490192345 (approximately -3π/4)
    • Returns the angle (in radians) from the X axis to a point.

      Parameters

      • y: number

        A numeric expression representing the cartesian y-coordinate.

      • x: number

        A numeric expression representing the cartesian x-coordinate.

      Returns number