< Previous Section | Home | Next Section>> |

Coordinate Conversions

There will be occasions when you need to convert from rectangular coordinates to polar coordinates.

A point’s distance from the pole is easy. If the point *P* has rectangular coordinates (*a*, *b*), denoted hereafter as P:(*a*, *b*), then, by the Pythagorean Theorem, $r= \sqrt{a^2+b^2}$. Or, defined as a function, if a point has coordinates (*x*, *y*), then the point’s distance from the pole is $r(x,y)= \sqrt{x^2+y^2}$.

Determining a point's angle from the reference direction (the positive *x*-axis) is a bit trickier than determining its distance from the origin.

As illustrated in Figure 11.2.1, if P:(*a*, *b*) is in the 1st or 4th quadrant, then the angle from the reference direction has a measure of $\atan(b/a)$.

There are two problems we must resolve to devise a method for finding a point's direction from the origin.

The **first problem** is the quotient of point R’s coordinates is the same as the quotient of P’s coordinates, so atan cannot distinguish between points R and P in terms of their direction from the positive *x*-axis.

We have a similar problem distinguishing between the direction of point S in the second quadrant from the direction of point R in the fourth quadrant. The quotient of S's coordinates is the same as the quotient of Q’s coordinates.

In short, atan cannot distinguish between directions of points P and R, nor can it distinguish between directions of points S and Q.

its direction from the positive x-axis is atan(b/a).

The **second problem** arises if a point is on the *y*-axis. The function $\atan(\theta)$ (arctangent $\theta$) is defined only for values of $\theta$ such that $-\dfrac{\pi}{2}\lt \theta \lt \dfrac{\pi}{2}$. It is not defined for $\theta= \dfrac{\pi}{2}$ (when a point is on the positive *y*-axis) or for $\theta= -\dfrac{\pi}{2}$ (when a point is on the negative *y* axis).

A solution to both problems is to define a new function that we will call **taninv** (tangent inverse). It will have two independent variables: the point’s *y*-coordinate and the point's *x* coordinate.

Any value of taninv will be a point’s direction from the positive *x*-axis, given as an angle measure in radians between 0 and $2\pi$.

Figure 11.2.2 gives the definition of taninv as it appears in GC (click here for the GC file). The key idea is to pay attention to whether a point’s *x*-coordinate is positive, negative, or zero.

- If $x > 0$ and $y > 0$, then atan($y/x$) gives the correct direction (see Figure 11.2.1).
- If $x > 0$ and $y < 0$, then atan$(y/x)$ will give a result between $-\pi/2$ and 0, so add $2\pi$ to give a result between $3\pi/2$ and $2\pi$.
- If $x < 0$, then the direction given by atan($y/x$) is off by a rotation of $\pi$ (see Figure 11.2.1), so add $\pi$ to the value of atan($y/x$).
- If $x=0$ and $y > 0$, the point is on the positive
*y*-axis. The point's direction from 0 (the reference direction) is $\pi/2$. - If $x=0$ and $y < 0$, the point is on the negative
*y*-axis. The point's direction from 0 (the reference direction) is $3\pi/2$. - You should notice that taninv(0,0) is undefined. This makes sense because the point (0,0) does not have a direction from (0,0).

The key idea in converting from polar to rectangular coordinates is that, in the unit circle, any point on the circle has coordinates $(\cos\theta,\sin\theta)$ where $\theta$ is the measure of the angle made by the point, (0,0), and the positive *x*-axis (Figure 11.2.3).

* Figure 11.2.3. *Polar coordinates $(1,\theta)$ converted to rectangular coordinates $(\cos\theta,\sin\theta)$.

The rectangular coordinates of points not on the unit circle will simply be the rectangular coordinates of the corresponding point on the unit circle, scaled by the point's distance from the origin (Figure 11.2.4)

**Figure 11.2.4. **Polar coordinates $(r,\theta)$ converted to rectangular coordinates $(r\cos\theta,r\sin\theta)$.

- Enter the definition of taninv (Figure 11.2.2) in GC.
- After completing Exercise 11.0.5, enter taninv(0,0). GC will display "not a number". This is GC’s way of saying that taninv(0,0) is undefined.
- Why is it reasonable that taninv(0,0) should be undefined? What would it mean were taninv(0,0) = 1?
- What is it about the definition of taninv that keeps GC from giving a value for taninv(0,0)?
- The following are points' coordinates in the polar system. Convert them from polar coordinates to rectangular coordinates.
- $(3,2)$
- $(-4,-1)$
- $(\sqrt 7,\sqrt 7)$
- $(0,5)$
- The following are points' coordinates in the rectangular system. Convert them from rectangular coordinates to polar coordinates.
- $(3,2)$
- $(-4,-1)$
- $(\sqrt 7,\sqrt 7)$
- $(0,5)$
- The set of points $(x,2)$ in rectanglar coordinates is the graph of $y=2$. Define a function
*f*so that GC's dispayed graph of $r=f(\theta)$ in polar coordinates is the same as GC's displayed graph of $y=2$ in rectangular coordinates.

*To do this, type "\taninv\ ctrl-9 x , y =" to start the definition. Type ctrl-shift-A to make the multipart definition. Type ctrl-shift-A to add a new line to the definition.*

Test your definition with coordinates having directions (in radians) that you know.

< Previous Section | Home | Next Section>> |