How polar coordinate conversion works
Rectangular coordinates locate a point by walking: x steps right, y steps up. Polar coordinates locate the same point by aiming: face angle θ (measured counterclockwise from the positive x-axis) and walk r units straight ahead. Both name every point in the plane; which one is convenient depends on the problem. Circles, spirals, orbits, and anything rotating are painful in x and y but almost trivially clean in r and θ — the circle x² + y² = 25 becomes simply r = 5.
Going from polar to rectangular is pure trigonometry with no traps: x = r·cos θ, y = r·sin θ, done. The reverse direction has one famous trap, which is why this calculator uses atan2 — read on.
The formula
Here (x, y) is the rectangular point, r is its distance from the origin (via the Pythagorean theorem), and θ is the angle from the positive x-axis. The function atan2(y, x) is the two-argument arctangent: it returns the angle of the point (x, y) anywhere in the plane, from −180° to +180°.
Worked example
Convert (3, 4) to polar. The radius is r = √(3² + 4²) = √25 = 5 (the classic 3-4-5 right triangle). The angle is θ = atan2(4, 3) ≈ 53.13° (about 0.9273 radians), in Quadrant I. So (3, 4) in polar form is (5, 53.13°). Run it in reverse to check: x = 5·cos(53.13°) ≈ 3 and y = 5·sin(53.13°) ≈ 4. Round trips like that are the fastest way to catch a conversion mistake.
Why atan2 beats plain arctan (the quadrant trap)
The naive formula θ = arctan(y⁄x) loses information the moment you divide: the points (3, 4) and (−3, −4) give the identical ratio 4⁄3, so arctan hands you the identical angle 53.13° for both — even though (−3, −4) sits in Quadrant III, a full 180° away. Ordinary arctan can only return angles between −90° and +90° (Quadrants I and IV), so every Quadrant II and III point comes out wrong, and x = 0 crashes the division outright. The fix is atan2(y, x), which keeps the two signs separate instead of collapsing them into a ratio: it knows (−3, −4) means “left and down” and correctly returns −126.87°. If you must use plain arctan by hand, the patch-up rule is: add 180° when x < 0, and let the sign of y break the tie on the axis. Or skip the ritual and use atan2 — every programming language has it, and it exists precisely because of this trap.
One convention worth knowing: a negative r is legal in polar coordinates and means “walk backwards” — the point (−5, 53.13°) is the same as (5, 233.13°), plotted in the direction opposite the angle. Textbooks use it for polar curves like r = cos(2θ) where the formula naturally dips negative. This calculator accepts negative r and does the sign bookkeeping for you; also remember polar names aren’t unique — adding 360° to θ leaves the point unchanged.