Atan2 Calculator

Get the point angle instantly.

How it is calculated

The tool returns the angle of the point (x, y) measured from the positive x-axis, counter-clockwise, using θ = atan2(y, x). Unlike atan(y / x), the two-argument form looks at the signs of both coordinates and so picks the correct quadrant. The angle comes back in degrees (rounded to four decimals) and in radians (six decimals), always in the range −180° to 180°. Points above the x-axis give positive angles, points below give negative ones; (5, 0) gives 0° and (−5, 0) gives 180°. The point (0, 0) has no direction, so the tool returns no result. Enter x first and y second, as on a graph.

Worked example

Take the point x = −3, y = 4, in the upper-left quadrant. The plain ratio y / x = −1.3333 would give about −53.13°, which points the wrong way. atan2 accounts for x being negative and y positive, adding half a turn: the angle is 180° − 53.1301° = 126.8699°. The calculator shows 126.8699 degrees, which is 2.214297 radians.

Try this example →

Common mistakes

  • Swapping x and y. The call is atan2(y, x); reversing them gives the angle measured from the y-axis instead.
  • Expecting a 0° to 360° answer. Results are between −180° and 180°; add 360° to a negative angle to get the compass-style value.
  • Dividing y by x first. That loses the sign information and puts the point in the wrong quadrant.
  • Reading the radians column as degrees. 2.214297 is radians, 126.8699 is degrees.
  • Entering the origin (0, 0), or reading the angle as a bearing. A bearing is measured clockwise from north, not counter-clockwise from east.

About this calculator

The two-argument arctangent, atan2(y, x), solves a problem the ordinary arctangent can't: atan(y/x) alone can't tell you which quadrant a point sits in, because the ratio y/x gives the same value whether both y and x are positive or both are negative. atan2 takes the x and y coordinates separately rather than their ratio, so it can return the correct full angle — from −180° to 180° (or −π to π radians) — no matter which of the four quadrants the point falls in.

Programming languages and math libraries expose atan2 as a standard function precisely because of this quadrant-correctness, and it's used throughout computer graphics and game development to compute an object's facing angle from a direction vector, in robotics and navigation to calculate heading or bearing between two coordinates, and anywhere else an angle needs to be recovered reliably from x and y components.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators