Understanding the polar and Cartesian coordinates converter — concept and principle
A point in the plane can be described in two common ways: by its horizontal and vertical distances from the origin (Cartesian x, y) or by its straight-line distance from the origin and its direction (polar r, θ). This converter switches between the two. It is used in trigonometry and calculus, physics (circular motion, forces), electrical engineering (phasors, complex numbers), robotics and graphics.
How it is calculated
- Cartesian to polar: r = √(x² + y²) and θ = atan2(y, x), converted to degrees by multiplying by 180/π.
- Polar to Cartesian: x = r cos θ and y = r sin θ, with θ entered in degrees.
Choose the direction with "Input is". In polar mode the first box is r and the second is θ in degrees. x, y and r share one length unit.
The principle
Drop a perpendicular from the point to the x-axis and you get a right triangle with legs |x| and |y| and hypotenuse r. The Pythagorean theorem gives r, and the definitions of cosine and sine (adjacent ÷ hypotenuse, opposite ÷ hypotenuse) give x = r cos θ and y = r sin θ. Going back, plain arctan(y/x) only returns −90° to 90°, so it cannot tell (1, 1) from (−1, −1). The two-argument function atan2(y, x) looks at the signs of both x and y and returns the correct angle in all four quadrants, in the range −180° to 180°.
Worked example
- Default inputs: x = 3, y = 4, input type Cartesian.
- r = √(3² + 4²) = √(9 + 16) = √25 = 5.
- Both coordinates are positive, so the point is in the first quadrant and θ = arctan(4/3).
- arctan(1.3333…) = 0.927295 rad × 180/π = 53.13010235°.
- Result: r = 5, θ = 53.13010235°.
How to read the result
r is never negative; it is the distance from the origin. θ is measured counter-clockwise from the positive x-axis. Angles from 0° to 90° are in quadrant I, 90° to 180° in quadrant II, and negative angles mean clockwise rotation: θ = −90° points straight down. Add 360° to a negative θ if you want a value between 0° and 360°. One polar point has many names: (5, 53.13°), (5, 413.13°) and (5, −306.87°) are the same point.
Common mistakes
- Using arctan(y/x) instead of atan2 and getting a point in the wrong quadrant, for example (−3, −4) is at −126.87°, not 53.13°.
- Entering θ in radians when the box expects degrees.
- Forgetting that at the origin (r = 0) the angle has no meaning; any θ describes the same point.
Frequently asked questions
What is the polar form of a complex number?
The complex number x + yi is the point (x, y), so its modulus is r = √(x² + y²) and its argument is θ = atan2(y, x). You can write it as r(cos θ + i sin θ).
Can r be negative?
Some textbooks allow a negative r, meaning "go in the opposite direction", so (−5, 233.13°) equals (5, 53.13°). This converter always returns r ≥ 0.
Why is θ between −180° and 180°?
That is the standard range of atan2. Add 360° to a negative value for the 0°–360° form.
Sources: NIST Digital Library of Mathematical Functions, §4.23 (inverse trigonometric functions, including the two-argument arctangent) · James Stewart, Calculus: Early Transcendentals, section on polar coordinates