Cartesian to Spherical Coordinates - Formulas and Examples

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
diagram of spherical coordinates

Relevant for...

Learning to transform from Cartesian to spherical coordinates.

See examples

TRIGONOMETRY
diagram of spherical coordinates

Relevant for...

Learning to transform from Cartesian to spherical coordinates.

See examples

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.

diagram of spherical coordinates

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:

QuadrantValue of $latex {{\tan}^{-1}}$
IWe use the value of the calculator
IIWe add 180° to the calculator value
IIIWe add 180° to the calculator value
IVWe 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})$
diagram to find spherical coordinates

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

EXAMPLE 2

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

Solution

EXAMPLE 3

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

Solution

EXAMPLE 4

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

Solution

Cartesian to spherical coordinates – practice problems

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

If we have the Cartesian coordinates (4, 2, 2), what is their equivalent in spherical coordinates?

Choose an answer






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

Choose an answer






What is the spherical coordinate equivalent of the Cartesian coordinates (-3, -1, 6)?

Choose an answer






If we have the Cartesian coordinates (4, -5, 1), what is their equivalent in spherical coordinates?

Choose an answer






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