A coordinate system is defined as a way to define and locate a point in space. The most widely used three-dimensional coordinate system is the Cartesian system, which has the form (x, y, z). However, there are alternative systems that may be more convenient depending on the situation. One of these systems is the spherical coordinate system. This system has the form (ρ, θ, φ), where, ρ is the distance from the origin to the point, θ is the angle formed with respect to the x-axis and φ is the angle formed with respect to the z-axis.

Here, we will learn more details about this coordinate system. Also, we will learn about the formulas used to convert from Cartesian to spherical coordinates and vice versa.

## What are spherical coordinates?

Spherical coordinates are a three-dimensional coordinate system. This system has the form (*ρ, θ, φ*), where *ρ* is the distance from the origin to the point, *θ* is the angle formed with respect to the *x*-axis and *φ* is the angle formed with respect to the *z*-axis.

The spherical coordinate system is useful when we want to graph spherical figures or figures that are defined using different angles. This coordinate system is mainly convenient in Calculus.

Many times, finding the derivatives or integrals of spherical figures can be easier using this system since we can describe the figures using simpler and more convenient equations.

## Examples of spherical coordinates

To graph a point that is represented in spherical coordinates, we can start by locating it with respect to its distance from the origin and its angle with respect to the *x*-axis. Then, we locate it with respect to the angle it makes from the *z*-axis. The diagram below represents the point $latex (3, \frac{\pi}{3}, \frac{\pi}{4})$.

We can see that the angle *φ* is measured from the positive *z-axis*. This angle goes from 0 to π. On the other hand, the angle *θ* has no restriction. This means that we actually have several ways of representing a point in spherical coordinates.

This is because, if we add or subtract 2π or a multiple of 2π, we get an equivalent angle. For example, the angles $latex \frac{\pi}{3}, \frac{4 \pi}{3}, \frac{2 \pi}{3}$ are equivalent.

## Spherical to Cartesian conversion formulas

Let’s use the following diagram to derive the formulas for converting spherical coordinates to Cartesian coordinates:

We can use right triangles and trigonometry to obtain equations for *ρ, θ, φ* in terms of *x, y, z*. The derivation of these equations is easier if we start transforming from spherical to cylindrical coordinates and then from cylindrical to Cartesian coordinates. Therefore, we use the following diagram:

We can find *r* and *z* using the sine and cosine functions respectively:

$latex z=\rho \cos(\phi)$

$latex r=\rho \sin(\phi)$

The third component here is $latex \theta$. Now, we use the transformation formulas from cylindrical to Cartesian coordinates:

$latex x=r~\cos(\theta)$

$latex y=r~\sin(\theta)$

$latex z=z~~~~~$

If we use these two sets of equations, we have:

$latex x=\rho \sin(\phi)\cos(\theta)$ $latex y=\rho \sin(\phi)\sin(\theta)$ $latex z=\rho \cos(\phi)~~$ |

Start now: Explore our additional Mathematics resources

#### EXAMPLE 1

If we have the spherical coordinates $latex (3, \frac{2 \pi}{3}, \frac{\pi}{4})$, what is their equivalent in Cartesian coordinates?

##### Solution

We have the values $latex \rho=3,~\theta=\frac{2\pi}{3},~\phi=\frac{\pi}{4}$. We use the values along with the formulas seen above to find the value of *x*:

$latex x=\rho~\sin(\phi)\cos(\theta)$

$latex x=3~\sin(\frac{\pi}{4})\cos(\frac{2\pi}{3})$

$latex x=-1.06$

The value of *y* is:

$latex y=\rho~\sin(\phi)\sin(\theta)$

$latex y=3~\sin(\frac{\pi}{4})\sin(\frac{2\pi}{3})$

$latex y=1.84$

The value of *z* is:

$latex z=\rho~\cos(\phi)$

$latex z=3~\cos(\frac{\pi}{4})$

$latex z=2.12$

The Cartesian coordinates of the point are (-1.06, 1.84, 2.12).

#### EXAMPLE 2

We have the spherical coordinates $latex (6, \frac{5 \pi}{3}, \frac{\pi}{2})$. What is its equivalent in Cartesian coordinates?

##### Solution

We have the values $latex \rho=6,~\theta=\frac{5\pi}{3},~\phi=\frac{\pi}{2}$. Therefore, we use the formulas along with these values to find the value of *x*:

$latex x=\rho~\sin(\phi)\cos(\theta)$

$latex x=6~\sin(\frac{\pi}{2})\cos(\frac{5\pi}{3})$

$latex x=3$

The value of *y* is:

$latex y=\rho~\sin(\phi)\sin(\theta)$

$latex y=6~\sin(\frac{\pi}{2})\sin(\frac{5\pi}{3})$

$latex y=-5.2$

The value of *z* is:

$latex z=\rho~\cos(\phi)$

$latex z=6~\cos(\frac{\pi}{2})$

$latex z=0$

The Cartesian coordinates of the point are (3, -5.2, 0).

## Cartesian to spherical conversion Formulas

To derive the conversion formulas from Cartesian coordinates to spherical coordinates, we use the same diagram:

The component *ρ* can be found in terms of *x, y, z* using the Pythagorean theorem in three dimensions. Therefore, we have:

$latex {{\rho}^2}={{x}^2}+{{y}^2}+{{z}^2}$

$latex \rho=\sqrt{{{x}^2}+{{y}^2}+{{z}^2}}$ |

The angle θ is found using the same cylindrical coordinate process. We use the inverse tangent, where, *y* is the opposite side of the angle and *x* is the adjacent side. Therefore, we have:

$latex \theta=\tan^{-1}(\frac{y}{x})$ |

Something that we must consider is that, many times the angle given by the calculator is not correct. This is because the inverse tangent function has a range from $latex – \frac{\pi}{2}$ to $latex \frac{\pi}{2}$, so it does not cover all four quadrants.

To correct this, we add 180° or π if the point is in the second or third quadrant and we add 360° or 2π if the point is in the fourth quadrant. If the point is in the first quadrant, the value given by the calculator is correct.

To find the angle *φ*, we can use the cosine function. We see that the side adjacent to this angle is the side *z *and the hypotenuse is equal to *ρ*. Thus, we have:

$latex \phi={{\cos}^{-1}}(\frac{z}{\rho})$ |

#### EXAMPLE 1

The point (2, 3, 4) is written in Cartesian coordinates. What is its equivalent in spherical coordinates?

##### Solution

We have the values $latex x=2, ~y=3,~z=4$. We find the values of ρ, θ and φ, using the derived formulas. Therefore, the value of ρ is:

$latex \rho=\sqrt{{{x}^2}+{{y}^2}+{{z}^2}}$

$latex \rho=\sqrt{{{2}^2}+{{3}^2}+{{4}^2}}$

$latex \rho=\sqrt{4+9+16}$

$latex \rho=\sqrt{29}$

$latex \rho=5.39$

Now, we use the inverse tangent to find θ:

$latex \theta={{\tan}^{-1}}(\frac{y}{x})$

$latex \theta={{\tan}^{-1}}(\frac{3}{2})$

$latex \theta=0.98$ rad

This value is correct since the point is in the first quadrant (*x* and *y* values are positive).

We use the inverse cosine to find the value of φ:

$latex \phi={{\cos}^{-1}}(\frac{z}{\rho})$

$latex \phi={{\cos}^{-1}}(\frac{4}{5.39})$

$latex \phi=0.73$ rad

The spherical coordinates of the point are (5.39, 0.98 rad, 0.73 rad).

#### EXAMPLE 2

If the point (-2, -4, 5) is in Cartesian coordinates, what is its equivalent in polar coordinates?

##### Solution

We have the values $latex x=-2, ~y=-4,~z=5$. We use the equations obtained along with these values to find the spherical coordinates. The value of ρ is:

$latex \rho=\sqrt{{{x}^2}+{{y}^2}+{{z}^2}}$

$latex \rho=\sqrt{{{(-2)}^2}+{{(-4)}^2}+{{5}^2}}$

$latex \rho=\sqrt{4+16+25}$

$latex \rho=\sqrt{45}$

$latex \rho=6.71$

The value of θ is:

$latex \theta={{\tan}^{-1}}(\frac{y}{x})$

$latex \theta={{\tan}^{-1}}(\frac{-4}{-2})$

$latex \theta=1.11$ rad

In this case, both the *x* component and the *y* component are negative. This means that the point is located in the third quadrant and we have to add 180° or π to get the correct angle. Therefore, the correct angle is $latex \theta=1.11+\pi=4.25$ rad.

The value of φ is:

$latex \phi={{\cos}^{-1}}(\frac{z}{\rho})$

$latex \phi={{\cos}^{-1}}(\frac{5}{6.71})$

$latex \phi=0.73$ rad

The spherical coordinates of the point are (6.71, 1.11 rad, 0.73 rad).

## See also

Interested in learning more about spherical coordinates? Take a look at these pages:

### Learn mathematics with our additional resources in different topics

**LEARN MORE**