Spherical coordinates are written in the form (*ρ, θ, φ*), where, *ρ* represents the distance from the origin to the point, *θ* represents the angle with respect to the *x-axis* in the xy plane and φ represents the angle formed with respect to the z-axis. Spherical coordinates can be useful when graphing spheres or other three-dimensional figures represented by angles. This coordinate system is particularly useful in calculus since it is generally easier to obtain the derivatives or integrals using this system when we have problems related to spheres or similar figures.

Here, we will learn about the formulas that we can use to transform from Cartesian to spherical coordinates. Then, we will use these formulas to solve some practice problems.

##### TRIGONOMETRY

**Relevant for**…

Learning to transform from Cartesian to spherical coordinates.

##### TRIGONOMETRY

**Relevant for**…

Learning to transform from Cartesian to spherical coordinates.

## How to transform from Cartesian coordinates to spherical coordinates?

We can transform from Cartesian coordinates to spherical coordinates using right triangles, trigonometry, and the Pythagorean theorem.

Cartesian coordinates are written in the form (*x, y, z*), while spherical coordinates have the form (*ρ, θ, φ*). In this form, *ρ* is the distance from the origin to a three-dimensional point, *θ* is the angle formed in the *xy* plane with respect to the *x*-axis, and *φ* is the angle formed with respect to the *z*-axis.

We can look at these components in the following diagram.

We can start by finding the length of *ρ* in terms of *x, y, z*. For this, we use the Pythagorean theorem in three dimensions. Therefore, we have that *ρ* squared is equal to the sum of the squares of *x, y, z*:

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

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

The angle θ is the same as that found when transforming to cylindrical coordinates. We find this angle using the inverse tangent function. The tangent of an angle is equal to the opposite side divided by the adjacent side.

In the diagram, we can see that the opposite side is equal to the *y* component and the adjacent side is the *x* component. Therefore, we have:

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

However, we must bear in mind that the angle *θ* given by the calculator is sometimes incorrect because the range of the inverse tangent function is $latex -\frac{\pi}{2}$ to $latex \frac{\pi}{2}$. This does not cover all four quadrants of the Cartesian plane, so we use the following table to correct this:

Quadrant | Value of $latex {{\tan}^{-1}}$ |

I | We use the value of the calculator |

II | We add 180° to the calculator value |

III | We add 180° to the calculator value |

IV | We add 360° to the calculator value |

Finally, we have the angle *φ*. This is the angle formed by the line and the positive *z*-axis. This angle goes from 0 to π. To find this angle, we can use the cosine function. The cosine is equal to the adjacent side divided by the hypotenuse.

In the diagram below, we see that the adjacent side is equal to the *z* component and the hypotenuse is equal to *ρ*. Therefore, we have:

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

Start now: Explore our additional Mathematics resources

## Cartesian to spherical coordinates – Examples with answers

The following examples can be used to understand the process of transforming Cartesian coordinates to spherical coordinates. Try to solve the problems yourself before looking at the answer.

**EXAMPLE 1**

We have the point (2, 3, 4) in Cartesian coordinates. What is its equivalent in spherical coordinates?

##### Solution

We have the values $latex x=2, ~y=3,~z=4$. We use the formulas given above to find the values of ρ, θ and φ. To find the value of ρ, we use the Pythagorean theorem in three dimensions:

$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$

We find θ, using the inverse tangent function:

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

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

$latex \theta=0.98$ rad

The *x* and *y* values are positive, so the point is in the first quadrant. Therefore, the angle obtained is correct.

To find the value of φ, we use the inverse cosine function:

$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, 0.73). The angles are written in radians.

**EXAMPLE 2**

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

##### Solution

We can recognize the $latex values x = 4, ~ y = 2, ~ z = 5$. We are going to find the values of ρ, θ and φ using the formulas seen above together with the given values. We start with the value of ρ:

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

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

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

$latex \rho=\sqrt{45}$

$latex \rho=6.71$

We use the inverse tangent to find θ:

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

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

$latex \theta=0.38$ rad

This value is correct since the point is located in the first quadrant.

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

$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, 0.38, 0.73). The angles are written in radians.

**EXAMPLE 3**

If we have the Cartesian coordinates (-4, 4, 6), what is their equivalence in spherical coordinates?

##### Solution

We have the values $latex x=-4, ~y=4,~z=6$. We use the transformation formulas along with the given values to find the values of ρ, θ and φ. The value of ρ is found using the Pythagorean theorem in three dimensions:

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

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

$latex \rho=\sqrt{16+16+36}$

$latex \rho=\sqrt{68}$

$latex \rho=8.25$

Now, we find θ, using the inverse tangent function:

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

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

$latex \theta=-0.78$ rad

The value of *x* is negative and the value of *y* is positive, so the point is located in the second quadrant. This means that we have to add 180° or π to find the correct angle. The correct angle is $latex \theta=-0.78+\pi=2.36$ rad.

To find the value of φ, we use the inverse cosine function:

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

$latex \phi={{\cos}^{-1}}(\frac{6}{8.25})$

$latex \phi=0.76$ rad

The spherical coordinates of the point are (8.25, 2.36, 0.76). The angles are written in radians.

**EXAMPLE 4**

We have the point (-2, -4, 5) in Cartesian coordinates. What is its equivalent in spherical coordinates?

##### Solution

We can recognize the values $latex x = -2, ~ y = -4, ~ z = 5$. Now, we find the values of ρ, θ and φ using the transformation formulas. To find the value of ρ, we use the Pythagorean theorem in three dimensions:

$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$

We find θ, using the inverse tangent function:

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

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

$latex \theta=1.11$ rad

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

To find the value of φ, we use the inverse cosine function:

$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, 0.73). The angles are written in radians.

## Cartesian to spherical coordinates – practice problems

Solve the following practice problems using the Cartesian to spherical coordinate transformation formulas seen above.

## 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**