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

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:

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 to . This does not cover all four quadrants of the Cartesian plane, so we use the following table to correct this:

Quadrant | Value of |

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:

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 . 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:

We find θ, using the inverse tangent function:

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:

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 . 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 ρ:

We use the inverse tangent to find θ:

rad

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

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

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 . 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:

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

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 rad.

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

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 . Now, we find the values of ρ, θ and φ using the transformation formulas. To find the value of ρ, we use the Pythagorean theorem in three dimensions:

We find θ, using the inverse tangent function:

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 rad.

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

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