# Rectangular, Cylindrical, and Spherical Coordinates

Since virtually everything we do in this course deals with three dimensional space, it makes sense to start with a short discussion of how to represent a point in 3-D space. Three dimensional space is often written $\mathbb{R}^3$ (read "R three"), to denote that we're dealing with real numbers in three dimensions; similarly, 2-D space is called $ℝ^2,$ the number line is called $ℝ,$ and n-dimensional space is called $ℝ^n.$

We'll cover three ways of describing the location of a point: with rectangular coordinates, cylindrical coordinates, and spherical coordinates. There are other coordinate systems (including some wacky ones like hyperbolic and spheroidal coordinates), but these are the ones that are most commonly used for three dimensions. We won't actually use cylindrical and spherical coordinates for a while, but getting a look at them now can help to get comfortable thinking in three dimensions, and when they come back again, we'll be at least somewhat comfortable with them.

As we go through this section, we'll see that in each coordinate system, a point in 3-D space is represented by three coordinates, just like a point in 2-D space is represented by two coordinates ($x$ and $y$ in rectangular, $r$ and $θ$ in polar).

# Rectangular Coordinates

Using rectangular coordinates, a point in $ℝ^3$ is represented by $(x,y,z).$ Similar to what we do in $ℝ^2,$ to get to a specified point, we start at the origin, travel along the $x$ axis the distance specified by the first coordinate, then parallel to the $y$ axis according to the second coordinate, and then up parallel to the $z$ axis according to the third coordinate.

We can also talk about the projection of a point (or a line or plane or other figure, later) onto one of the three planes that make up the coordinate system: the $xy$ plane (where $z=0$), the $yz$ plane (where $x=0$), and the $xz$ plane (where $y=0$). To project a point onto any one of these planes, simply set the appropriate coordinate to zero.

# Cylindrical Coordinates

Cylindrical coordinates are essentially polar coordinates in $ℝ^3.$ Remember, polar coordinates specify the location of a point using the distance from the origin and the angle formed with the positive $x$ axis when traveling to that point. Cylindrical coordinates use those those same coordinates, and add $z$ for the third dimension. In other words, to find a point $(r,θ,z)$ in cylindrical coordinates, find the point $(r,θ)$ in the $xy$ plane, then move straight up (parallel to the $z$ axis) according to the third dimension given.

For instance, the point $(3,\dfrac{π}{4},4)$ in cylindrical coordinates is shown below.

## Converting Between Rectangular and Cylindrical Coordinates

Converting rectangular coordinates to cylindrical coordinates and vice versa is straightforward, provided you remember how to deal with polar coordinates. To convert from cylindrical coordinates to rectangular, use the following set of formulas: $\begin{aligned} x &= r\cos θ\ y &= r\sin θ\ z &= z \end{aligned}$

Notice that the first two are identical to what we use when converting polar coordinates to rectangular, and the third simply says that the $z$ coordinates are equal in the two systems.

## Cylindrical to Rectangular

Convert $(3,\dfrac{π}{4},4)$ in cylindrical coordinates to rectangular coordinates.

### Solution

Use the formulas, noting that $r=3,$ $θ=π/4,$ and $z=4.$

$\begin{aligned} x &= r\cos θ = 3\cos \dfrac{π}{4}=\dfrac{3\sqrt{2}}{2}\ y &= r\sin θ = 3\sin \dfrac{π}{4}=\dfrac{3\sqrt{2}}{2}\ z &= z=4 \end{aligned}$

Therefore, this point is $\ans{\left(\dfrac{3\sqrt{2}}{2},\dfrac{3\sqrt{2}}{2},4\right)}$ in rectangular coordinates.

To go in the other direction (from rectangular coordinates to cylindrical), use the following set of formulas (again, the first two are exactly what we use to convert from rectangular to polar in $ℝ^2$):

$\begin{aligned} r &= \sqrt{x^2+y^2}\ θ &= \tan^{−1}\dfrac{y}{x}\ z &= z \end{aligned}$

## Rectangular to Cylindrical

Convert $(−2,2,6)$ in rectangular coordinates to cylindrical coordinates.

### Solution

Use the formulas, noting that $x=−2,$ $y=2,$ and $z=6.$

$\begin{aligned} r &= \sqrt{x^2+y^2} =\sqrt{8}=2\sqrt{2}\ θ &= \tan^{−1} \dfrac{y}{x}=\tan^{−1}(−1)=\dfrac{3π}{4}\ z &= z=6 \end{aligned}$

Therefore, this point is $\ans{\left(2\sqrt{2},\dfrac{3π}{4},6\right)}$ in cylindrical coordinates.

# Spherical Coordinates

Spherical coordinates are similar to the way we describe a point on the surface of the earth using latitude and longitude. By specifying the radius of a sphere and the latitude and longitude of a point on the surface of that sphere, we can describe any point in $ℝ^3.$ To describe the latitude and longitude, we use two angles: $θ$ (the angle from the positive $x$ axis) and $ϕ$ (the angle from the positive $z$ axis). We therefore have three coordinates $(ρ,θ,ϕ),$ where $ρ$ is the radius of the sphere.

Note that $\begin{aligned} 0 &≤ θ <2π\ 0 &≤ ϕ ≤π\ ρ &≥ 0 \end{aligned}$

## Converting Between Rectangular and Spherical Coordinates

The formulas that we need in order to convert between rectangular and spherical coordinates are given below, without derivation (although they aren't hard to derive; you should look at the figure above and see if you can make sense of them).

$\begin{aligned} ρ &= \sqrt{x^2+y^2+z^2}\ x &= ρ \cos θ \sin ϕ\ y &= ρ \sin θ \sin ϕ\ z &= ρ \cos ϕ \end{aligned}$

## Spherical to Rectangular

Convert $\left(5,π,\dfrac{π}{2}\right)$ in spherical coordinates to rectangular coordinates.

### Solution

Use the formulas, noting that $ρ=5,$ $θ=π,$ and $ϕ=\dfrac{π}{2}.$

$\begin{aligned} x &= ρ \cos θ \sin ϕ=5(\cos π)\left(\sin \dfrac{π}{2}\right)=5(−1)(1)=−5\ y &= ρ \sin θ \sin ϕ=5(\sin π)\left(\sin \dfrac{π}{2}\right)=5(0)(1)=0\ z &= ρ \cos ϕ=5 \cos \dfrac{π}{2}=5(0)=0 \end{aligned}$

Therefore, this point is $\ans{(−5,0,0)}$ in rectangular coordinates.

## Rectangular to Spherical

Convert $(3,4,7)$ in rectangular coordinates to spherical coordinates.

### Solution

Use the formula for $ρ$ first. $ρ=\sqrt{x^2+y^2+z^2}=\sqrt{74}$

Then, find $ϕ$ by noting that $\cos ϕ=\dfrac{z}{ρ}.$ $ϕ=\cos^{−1}\dfrac{z}{ρ}=\cos^{−1}\dfrac{7}{\sqrt{74}} = 0.62 \textrm{ radians}$

Finally, use the fact that $\cos θ=\dfrac{x}{ρ \sin ϕ}$ to find $θ$. $θ=\cos^{−1}\dfrac{x}{ρ\sin ϕ}=\cos^{−1}\dfrac{3}{\sqrt{74} \sin 0.62} = 0.93 \textrm{ radians}$

Therefore, this point is $\ans{(\sqrt{74},0.93,0.62)}$ in spherical coordinates.

# Summary

$\begin{array}{c c c} \textrm{Rectangular} & \textrm{Cylindrical} & \textrm{Spherical}\ x,y,z) & (r,θ,z) & (ρ,θ,ϕ) \end{array}$

### Rectangular $\leftrightarrow$ Cylindrical

$\begin{aligned} x &= r\cos θ\ y &= r\sin θ\ z &= z \end{aligned}$

$\begin{aligned} r &= \sqrt{x^2+y^2}\ θ &= \tan^{−1}\dfrac{y}{x}\ z &= z \end{aligned}$

### Rectangular $\leftrightarrow$ Spherical

$\begin{aligned} x &= ρ \cos θ \sin ϕ\ y &= ρ \sin θ \sin ϕ\ z &= ρ \cos ϕ \end{aligned}$

$\begin{aligned} ρ &= \sqrt{x^2+y^2+z^2}\ ϕ &= \cos^{-1}\dfrac{z}{ρ}\ θ &= \cos^{-1}\dfrac{x}{ρ \sin ϕ} \end{aligned}$