Converting between polar and rectangular
An instrument reports where something is as a distance and an angle, but the map is a grid of east and north. How do you turn one kind of name into the other, both ways?
Where you are 3 in Polar coordinates
When you reach for it
Genji maps an archaeological dig. A surveying instrument called a total station stands on a tripod over a fixed point, the datum, and for each find it reports a distance in meters and an angle. Surveyors usually count angles clockwise from north; in this lesson, to match the mathematician’s convention, the team’s angles are taken counterclockwise from grid east. The site plan, though, is a grid of meters east and north of the datum. Every find arrives in polar coordinates (Plotting polar points) and has to be drawn in rectangular ones. Going back the other way, to set out a planned test pit with the instrument, a grid position has to become a distance and an angle.
This lesson moves single points between the two systems, in both directions. Throughout, the pole sits at the origin and the polar axis runs along the positive x-axis.
The procedure
From polar to rectangular
Take a point with polar name (r, \theta) and suppose first that r > 0. The ray at angle \theta crosses the unit circle at (\cos\theta, \sin\theta): that is the definition of cosine and sine (Trig functions on the unit circle), and it holds for every angle, not only acute ones. The point r units out along the same ray is that unit-circle point stretched away from the origin by the factor r, which keeps it on the ray and multiplies its distance by r. Stretching by r multiplies both coordinates by r, so
In quadrant I this is the right-triangle picture: r is the hypotenuse, x the adjacent leg and y the opposite leg, so \displaystyle \cos\theta = \frac{x}{r} and \displaystyle \sin\theta = \frac{y}{r}.
The same two formulas cover every other polar name. If r < 0, the walk goes |r| units backward along the ray, which reaches
If r = 0, both formulas give (0, 0), the pole, whatever \theta is. So there is no case to split: the signs of x and y come out of the signs of r, \cos\theta and \sin\theta by themselves.
From rectangular to polar: the distance
Now start from (x, y) and look for a name with r > 0. The distance from the origin is given by the The distance formula, the same length computation that finds the Magnitude and direction of a vector from its components:
The formulas above agree. Squaring and adding, then using the Pythagorean identity,
That relation r^2 = x^2 + y^2 holds for negative r as well, which is why it fixes only the size of r, never its sign.
The angle: the tangent, then the signs
Dividing y = r\sin\theta by x = r\cos\theta when x \ne 0 gives
This equation alone does not fix the ray. The tangent repeats every \pi, so in one full turn there are two angles with a given tangent, a half turn apart, on opposite rays. The points (x, y) and (-x, -y) give the same ratio and lie on those two rays. The arctangent (Inverse trigonometric ratios) always returns an angle strictly between \displaystyle -\frac{\pi}{2} and \displaystyle \frac{\pi}{2}, which is a ray into the right half of the plane, where x > 0. So the sign of x decides:
Any coterminal angle \theta + 2\pi k names the same ray; add 2\pi when the answer is wanted in 0 \le \theta < 2\pi and the first line gave a negative angle. Afterward, the signs of x and y name the quadrant, and the angle found must lie in it.
On the axes and at the origin
When x = 0 the ratio \displaystyle \frac{y}{x} does not exist, and none is needed: the point is on the y-axis, |y| units from the origin, so \displaystyle \theta = \frac{\pi}{2} when y > 0 and \displaystyle \theta = \frac{3\pi}{2} when y < 0. When y = 0 and x \ne 0 the point is on the x-axis, at \theta = 0 when x > 0 and \theta = \pi when x < 0. The origin has r = 0, and (0, \theta) names it for every \theta; it has no name with r > 0.
A name with negative r
Since (r, \theta) and (-r, \theta + \pi) name the same point, a name with negative r comes from the positive one by changing the sign of r and adding a half turn:
When x < 0 this makes the arctangent’s own answer useful: the formula for x < 0 is \displaystyle \theta = \arctan\frac{y}{x} + \pi, so the negative name has angle \displaystyle \arctan\frac{y}{x} plus a full turn, which is the same ray. Facing the ray the arctangent points to and walking backward reaches the point.
Worked examples
Polar names with exact values
Convert \displaystyle A = \left(6, \frac{5\pi}{6}\right), \displaystyle B = \left(-4, \frac{\pi}{3}\right) and \displaystyle C = \left(7, -\frac{\pi}{2}\right) to rectangular coordinates.
SolutionA: on the unit circle, \displaystyle \cos\frac{5\pi}{6} = -\frac{\sqrt{3}}{2} and \displaystyle \sin\frac{5\pi}{6} = \frac{1}{2}. So \displaystyle x = 6 \cdot \left(-\frac{\sqrt{3}}{2}\right) = -3\sqrt{3} and \displaystyle y = 6 \cdot \frac{1}{2} = 3, giving \displaystyle A = (-3\sqrt{3}, 3). The angle is in quadrant II and so are the signs.
B: the formulas hold for negative r unchanged. \displaystyle x = -4 \cdot \frac{1}{2} = -2 and \displaystyle y = -4 \cdot \frac{\sqrt{3}}{2} = -2\sqrt{3}, so \displaystyle B = (-2, -2\sqrt{3}). This matches the picture: face \displaystyle \frac{\pi}{3}, into quadrant I, and walk backward into quadrant III.
C: \displaystyle \cos\left(-\frac{\pi}{2}\right) = 0 and \displaystyle \sin\left(-\frac{\pi}{2}\right) = -1, so C = (0, -7), straight below the origin.
A find on the dig
The total station records a find at distance 34 meters and angle 128^\circ. Where does Genji plot it on the site plan, to the nearest hundredth of a meter?
SolutionThe angle is in degrees, so the calculator must be in degree mode.
The find is 20.93 meters west and 26.79 meters north of the datum, at about (-20.93, 26.79). Check: 128^\circ lies between 90^\circ and 180^\circ, so the find should be west and north, and \displaystyle \sqrt{20.93^2 + 26.79^2} \approx 34.00 returns the distance.
Where the arctangent is right, and where it is not
Give polar names with r > 0 and 0 \le \theta < 2\pi for \displaystyle (2\sqrt{3}, -2) and (-7, 7).
SolutionFor \displaystyle (2\sqrt{3}, -2): \displaystyle r = \sqrt{12 + 4} = 4 and \displaystyle \tan\theta = \frac{-2}{2\sqrt{3}} = -\frac{1}{\sqrt{3}}. Here x > 0, so the arctangent gives the right ray: \displaystyle \arctan\left(-\frac{1}{\sqrt{3}}\right) = -\frac{\pi}{6}. Adding 2\pi puts it in the window, so the point is \displaystyle \left(4, \frac{11\pi}{6}\right), in quadrant IV like \displaystyle (2\sqrt{3}, -2).
For (-7, 7): \displaystyle r = \sqrt{49 + 49} = 7\sqrt{2} and \displaystyle \tan\theta = \frac{7}{-7} = -1. The arctangent gives \displaystyle -\frac{\pi}{4}, a ray into quadrant IV, but (-7, 7) is in quadrant II. That ray passes through (7, -7), which has the same ratio. Since x < 0, add \pi: \displaystyle -\frac{\pi}{4} + \pi = \frac{3\pi}{4}. The point is \displaystyle \left(7\sqrt{2}, \frac{3\pi}{4}\right).
A point in quadrant III
Convert (-8, -3) to polar form with r > 0 and 0 \le \theta < 2\pi, angle to the nearest hundredth of a radian. Then give a name with negative r.
Solution\displaystyle r = \sqrt{64 + 9} = \sqrt{73} \approx 8.54. The ratio is \displaystyle \frac{-3}{-8} = \frac{3}{8}, and \displaystyle \arctan\frac{3}{8} \approx 0.3588 points into quadrant I, at (8, 3), opposite the point. Since x < 0,
so the point is \displaystyle (\sqrt{73}, 3.50). Check: 3.50 lies between \pi \approx 3.14 and \displaystyle \frac{3\pi}{2} \approx 4.71, so the ray is in quadrant III, as both coordinates are negative.
For negative r, take away the half turn: 3.5004 - \pi \approx 0.3588. The name is \displaystyle (-\sqrt{73}, 0.36): face the ray the arctangent gave and walk \displaystyle \sqrt{73} units backward.
On the axes, and the origin
Give a name with r > 0 and 0 \le \theta < 2\pi, and one with r < 0, for (0, -13) and (-11, 0). Then say what can be said about the origin.
Solution(0, -13) is on the y-axis, 13 units below the origin. No ratio is needed: the ray pointing straight down is \displaystyle \frac{3\pi}{2}, so the point is \displaystyle \left(13, \frac{3\pi}{2}\right). With negative r: \displaystyle \left(-13, \frac{\pi}{2}\right), facing up and walking backward.
(-11, 0) is 11 units left of the origin, on the ray \pi: (11, \pi). With negative r: (-11, 0), facing the polar axis and walking backward. Read with care: as a polar name, this pair means the point whose rectangular name is the same pair of numbers, (-11, 0), which happens only because the angle is 0.
The origin is (0, \theta) for every \theta. It has no name with r > 0 and no single angle.
Setting out a test pit
Hikari plans a test pit 15 meters west and 20 meters south of the datum. What distance and angle, to the nearest hundredth of a degree, should she give the total station? Give the negative-r name too.
SolutionThe pit is at (-15, -20). Its distance is \displaystyle r = \sqrt{225 + 400} = \sqrt{625} = 25 meters. The ratio is \displaystyle \frac{-20}{-15} = \frac{4}{3}, and \displaystyle \arctan\frac{4}{3} \approx 53.13^\circ points north of east, the opposite way. Since x < 0, add a half turn:
She sets the angle to 233.13^\circ and measures out 25 meters: (25, 233.13^\circ). Check: 25\cos 233.13^\circ \approx -15.00 and 25\sin 233.13^\circ \approx -20.00.
The negative-r name is (-25, 53.13^\circ): aim the instrument at 53.13^\circ and the pit is 25 meters directly behind it.
How far apart are two finds
Junpei records two finds at (20, 30^\circ) and (30, 150^\circ). How far apart are they?
SolutionPolar coordinates cannot simply be subtracted: (30 - 20, 150^\circ - 30^\circ) means nothing about the gap between the finds. Converting both to rectangular coordinates turns the question into the distance formula.
The differences are \displaystyle -15\sqrt{3} - 10\sqrt{3} = -25\sqrt{3} and 15 - 10 = 5, so
The finds are about 43.59 meters apart. Check with the law of cosines, since the rays meet at 120^\circ:
Boundaries
The arctangent alone gives only half the plane. \displaystyle \tan\theta = \frac{y}{x} holds on two opposite rays, and the arctangent always picks the one with x > 0. For a point with x < 0 the angle needs \pi (or 180^\circ) added. Some calculators and programs have a two-argument function, often written \operatorname{atan2}(y, x), that reads the signs itself.
The ratio does not exist on the y-axis. When x = 0 the angle is read off directly: \displaystyle \frac{\pi}{2} above the origin, \displaystyle \frac{3\pi}{2} below.
The origin has no angle. r = 0 there, and every \theta names it.
Units and conventions travel with the numbers. x = r\cos\theta needs the calculator in the same unit as \theta, and the formulas assume the angle is measured counterclockwise from the positive x-axis. An instrument that counts clockwise from north gives a bearing, which must be converted first (Bearings and navigation).
Where this goes next
The same substitutions rewrite a whole curve: replacing x and y by r\cos\theta and r\sin\theta, or x^2 + y^2 by r^2, is Converting an equation between the two systems, and it is how polar circles are recognized. For a complex number x + yi, the distance and angle found here are its modulus and argument, and x = r\cos\theta, y = r\sin\theta give its polar form.
Exercises
Polar to rectangular
Give exact rectangular coordinates.
- \displaystyle \left(10, \frac{\pi}{3}\right)
- \displaystyle \left(4, \frac{3\pi}{4}\right)
- \displaystyle \left(12, \frac{4\pi}{3}\right)
- \displaystyle \left(-6, \frac{\pi}{4}\right)
- \displaystyle \left(-8, \frac{5\pi}{6}\right)
- \displaystyle \left(5, \frac{5\pi}{2}\right)
Give rectangular coordinates to the nearest hundredth.
- \left(9, 2\right), with \theta in radians
- (15, 250^\circ)
Rectangular to polar
Give a name with r > 0 and 0 \le \theta < 2\pi: exact for 9 to 13, with r exact and \theta to the nearest hundredth for 14 to 16.
- \displaystyle (-4, 4\sqrt{3})
- (11, -11)
- \displaystyle (-\sqrt{3}, -1)
- (0, -6.5)
- (-2.4, 0)
- (15, 8)
- (-20, 21)
- (-3, -10)
Names with negative r
Give a name with r < 0 and 0 \le \theta < 2\pi.
- \displaystyle (5, -5\sqrt{3})
- (-10, -10)
- (0, 4.5)
On the dig
- The total station records a find at (26, 305^\circ). Where does Genji plot it, to the nearest tenth of a meter east or west and north or south of the datum?
- Hikari plans a test pit 24 meters west and 7 meters north of the datum. What distance and angle (nearest hundredth of a degree) should she give the instrument?
- Junpei records finds at (24, 40^\circ) and (10, 160^\circ). How far apart are they, to the nearest hundredth of a meter?
Reasoning
- Explain why x = r\cos\theta and y = r\sin\theta still give the right point when r < 0.
- For the point (-9, -2), Hikari enters \displaystyle \arctan\frac{-2}{-9} and reports \displaystyle (\sqrt{85}, 0.22). Which point did she name? Give the correct name with r > 0 and 0 \le \theta < 2\pi, and a correct name that uses her angle.
- Using x = r\cos\theta and y = r\sin\theta, show that (r, \theta) and (-r, \theta + \pi) give the same x and y.
Answers
- \displaystyle (5, 5\sqrt{3}). \displaystyle x = 10 \cdot \frac{1}{2}, \displaystyle y = 10 \cdot \frac{\sqrt{3}}{2}.
- \displaystyle (-2\sqrt{2}, 2\sqrt{2}). \displaystyle \cos\frac{3\pi}{4} = -\frac{\sqrt{2}}{2} and \displaystyle \sin\frac{3\pi}{4} = \frac{\sqrt{2}}{2}.
- \displaystyle (-6, -6\sqrt{3}). \displaystyle \cos\frac{4\pi}{3} = -\frac{1}{2} and \displaystyle \sin\frac{4\pi}{3} = -\frac{\sqrt{3}}{2}.
- \displaystyle (-3\sqrt{2}, -3\sqrt{2}). \displaystyle x = -6 \cdot \frac{\sqrt{2}}{2}, and y is the same; facing quadrant I and walking backward lands in quadrant III.
- \displaystyle (4\sqrt{3}, -4). \displaystyle x = -8 \cdot \left(-\frac{\sqrt{3}}{2}\right), \displaystyle y = -8 \cdot \frac{1}{2}.
- (0, 5). \displaystyle \frac{5\pi}{2} is coterminal with \displaystyle \frac{\pi}{2}, straight up.
- (-3.75, 8.18). 9\cos 2 \approx -3.745 and 9\sin 2 \approx 8.184, in radian mode.
- (-5.13, -14.10). 15\cos 250^\circ \approx -5.130 and 15\sin 250^\circ \approx -14.095.
- \displaystyle \left(8, \frac{2\pi}{3}\right). \displaystyle r = \sqrt{16 + 48} = 8; \displaystyle \tan\theta = -\sqrt{3} and x < 0, so \displaystyle \theta = -\frac{\pi}{3} + \pi.
- \displaystyle \left(11\sqrt{2}, \frac{7\pi}{4}\right). \tan\theta = -1, x > 0, so \displaystyle \theta = -\frac{\pi}{4} + 2\pi.
- \displaystyle \left(2, \frac{7\pi}{6}\right). \displaystyle r = \sqrt{3 + 1} = 2; \displaystyle \tan\theta = \frac{1}{\sqrt{3}} and x < 0, so \displaystyle \theta = \frac{\pi}{6} + \pi.
- \displaystyle \left(6.5, \frac{3\pi}{2}\right). On the y-axis, below the origin.
- (2.4, \pi). On the x-axis, left of the origin.
- (17, 0.49). \displaystyle r = \sqrt{225 + 64} = 17; x > 0, so \displaystyle \theta = \arctan\frac{8}{15} \approx 0.4900.
- (29, 2.33). \displaystyle r = \sqrt{400 + 441} = 29; \displaystyle \arctan\left(-\frac{21}{20}\right) \approx -0.8098, plus \pi gives 2.3318.
- \displaystyle (\sqrt{109}, 4.42). \displaystyle r = \sqrt{9 + 100}; \displaystyle \arctan\frac{10}{3} \approx 1.2793, plus \pi gives 4.4209, in quadrant III.
- \displaystyle \left(-10, \frac{2\pi}{3}\right). The positive name is \displaystyle \left(10, \frac{5\pi}{3}\right); change the sign of r and take away \pi.
- \displaystyle \left(-10\sqrt{2}, \frac{\pi}{4}\right). The positive name is \displaystyle \left(10\sqrt{2}, \frac{5\pi}{4}\right).
- \displaystyle \left(-4.5, \frac{3\pi}{2}\right). The point is \displaystyle \left(4.5, \frac{\pi}{2}\right); face down and walk backward.
- (14.9, -21.3): 14.9 meters east and 21.3 meters south. 26\cos 305^\circ \approx 14.91 and 26\sin 305^\circ \approx -21.30.
- 25 meters at 163.74^\circ. \displaystyle r = \sqrt{576 + 49} = 25; \displaystyle \arctan\left(-\frac{7}{24}\right) \approx -16.26^\circ, and x < 0, so add 180^\circ.
- About 30.27 meters. The finds are at about (18.39, 15.43) and (-9.40, 3.42), and \displaystyle \sqrt{27.78^2 + 12.01^2} \approx 30.27. Exactly, \displaystyle \sqrt{916} = 2\sqrt{229}, which the law of cosines confirms: 576 + 100 - 480\cos 120^\circ = 916.
- With r < 0 the walk goes |r| units along the opposite direction, from the origin to -|r|(\cos\theta, \sin\theta). Since -|r| = r, that point is (r\cos\theta, r\sin\theta).
- Her name \displaystyle (\sqrt{85}, 0.22) is the point (9, 2), in quadrant I, opposite the true point. Since x < 0, the correct angle is 0.2187 + \pi \approx 3.36: \displaystyle (\sqrt{85}, 3.36). Her angle does work with negative r: \displaystyle (-\sqrt{85}, 0.22).
- The point at \theta + \pi on the unit circle is diametrically opposite the point at \theta, so \cos(\theta + \pi) = -\cos\theta and \sin(\theta + \pi) = -\sin\theta. Then (-r)\cos(\theta + \pi) = (-r)(-\cos\theta) = r\cos\theta, and in the same way (-r)\sin(\theta + \pi) = r\sin\theta.