Multivariable Calculus • Vectors and Geometry in 3D

Cartesian to Spherical — Convert between Cartesian and spherical coordinates

Learn to describe any point in 3D space using distance and two angles instead of three straight-line measurements.

Multivariable Calculus emblem with three-dimensional axes, a function, and an orbiting path.
Inside this lesson 10 sections 5 questions 9 figures

SECTION 1

Historical Context & Motivation

For centuries, mathematicians and astronomers have wrestled with a deceptively simple question: what is the best way to pinpoint a location in three-dimensional space? The familiar Cartesian coordinate system, with its perpendicular x-, y-, and z-axes, works beautifully for cubes and flat surfaces. But the universe is full of spheres — planets, stars, radar signals, even sound waves radiating from a speaker. When the geometry is round, spherical coordinates become the natural language for describing position.

1637 • Descartes Publishes La Géométrie

René Descartes introduces the Cartesian coordinate system, linking algebra and geometry for the first time. His framework of perpendicular axes becomes the default way to locate points in space.

1687 • Newton's Principia

Isaac Newton uses radial distance and angles to describe planetary orbits, foreshadowing the usefulness of non-Cartesian coordinates for problems involving central forces and spherical symmetry.

1781 • Euler and Spherical Coordinates

Leonhard Euler formalizes the spherical coordinate system (ρ, θ, φ) and establishes the conversion formulas still used today, enabling elegant solutions to problems on spheres.

1900s • Modern Applications Explode

Spherical coordinates become essential in GPS technology, 3D graphics, quantum mechanics, and electromagnetic theory — anywhere that distance and direction from a central point matter.

So the central question is: how do you translate a point given as (x, y, z) into a description based on how far the point is from the origin, how far it tilts from the vertical, and how far it rotates around the vertical axis? That is exactly what converting from Cartesian to spherical coordinates accomplishes.

SECTION 2

Core Principles & Definitions

Before diving into formulas, you need a clear picture of what the three spherical coordinates actually measure. Every point in 3D space can be described by a trio (ρ, θ, φ) instead of the usual (x, y, z). Each of these three values captures a different geometric idea.

1

ρ (rho) — Radial Distance

The straight-line distance from the origin to the point. Think of it as the length of a string stretched from (0, 0, 0) to your point. ρ is always ≥ 0.
2

θ (theta) — Polar Angle

The angle measured down from the positive z-axis to the line segment connecting the origin to the point. It ranges from 0 (pointing straight up) to π (pointing straight down). Sometimes called the zenith angle or colatitude.
3

φ (phi) — Azimuthal Angle

The angle in the xy-plane measured counterclockwise from the positive x-axis. It is exactly the same angle you would use in polar coordinates. φ ranges from 0 to 2π.
4

Convention Warning

Some textbooks swap the meanings of θ and φ! In this lesson we use the ISO/physics convention: θ is the polar (vertical) angle, φ is the azimuthal (horizontal) angle. Always check your textbook.
✦

KEY TAKEAWAY

Imagine standing at the center of a giant transparent globe. ρ tells you how long your arm needs to be to touch a point on or inside the globe. θ tells you how far to tilt your arm downward from the North Pole. φ tells you how far to rotate your arm around the equator, just like reading longitude on a map.

SECTION 3

Visual Explanation

The diagram below shows how a single point P is located using both coordinate systems simultaneously. The Cartesian coordinates (x, y, z) are read off the rectangular axes, while the spherical coordinates (ρ, θ, φ) are read from the distance and two angles.

xyzOriginP(x, y, z)ρzr (proj.)θφx = ρ sin θ cos φy = ρ sin θ sin φz = ρ cos θLegendρ — radial distanceθ — polar angle (from z)φ — azimuthal angle (in xy)
The point P is connected to the origin by the pink line segment ρ. The purple arc θ shows the tilt from the z-axis, and the cyan arc φ shows the rotation in the xy-plane. Dashed lines indicate the Cartesian projections.

Notice how the dashed vertical line from P down to the xy-plane has length z, while the dashed horizontal line from the foot of that vertical to the origin has length r (the projection of ρ onto the xy-plane). This right triangle is the key to deriving every conversion formula. The polar angle θ sits at the origin between the z-axis and the ρ line, and the azimuthal angle φ sits in the xy-plane between the positive x-axis and the projection r.

SECTION 4

Mathematical Framework

Converting from Cartesian (x, y, z) to spherical (ρ, θ, φ) requires three formulas. Each one is derived from the right triangles visible in the diagram above. Let's walk through them one at a time.

From Cartesian to Spherical

RADIAL DISTANCE

ρ=√(x2+y2+z2)ρ = √(x² + y² + z²)

This is just the 3D distance formula — the straight-line distance from the origin to the point (x, y, z). It is always non-negative.

POLAR ANGLE

θ=arccos(z/ρ)=arccos(z/√(x2+y2+z2))θ = arccos(z / ρ) = arccos(z / √(x² + y² + z²))

Since cos θ = adjacent / hypotenuse = z / ρ, the inverse cosine gives θ directly. This angle always falls between 0 and π (0° and 180°).

AZIMUTHAL ANGLE

φ=arctan(y/x)(adjustedforquadrant)φ = arctan(y / x) (adjusted for quadrant)

This is the same angle you use in 2D polar coordinates. Use atan2(y, x) on a calculator or in code to get the correct quadrant automatically. φ ranges from 0 to 2π (or −π to π, depending on convention).

The Reverse: Spherical to Cartesian

INVERSE FORMULAS

x=ρsinθcosφ,y=ρsinθsinφ,z=ρcosθx = ρ sin θ cos φ, y = ρ sin θ sin φ, z = ρ cos θ

These come from projecting ρ onto the z-axis (giving z = ρ cos θ) and onto the xy-plane (giving r = ρ sin θ), then breaking r into x and y components using φ.

💡

Why arccos for θ but arctan for φ?

For θ, we know z and ρ directly, and cos θ = z / ρ gives a unique answer in [0, π]. For φ, we only have x and y in the horizontal plane. The ratio y / x can be the same for two different quadrants (e.g., both positive and both negative), so atan2 is needed to distinguish them.

SECTION 5

Handling Quadrants & Special Cases

The trickiest part of converting Cartesian to spherical is getting the azimuthal angle φ correct. The basic arctan(y / x) formula only returns values between −π/2 and π/2, which covers just two of the four quadrants. The diagram below maps out what adjustment is needed depending on the signs of x and y.

Azimuthal Angle φ by Quadrant (xy-plane view)+x+yQ I: x > 0, y > 0φ = arctan(y/x)0 < φ < π/2Q II: x < 0, y > 0φ = arctan(y/x) + ππ/2 < φ < πQ III: x < 0, y < 0φ = arctan(y/x) + ππ < φ < 3π/2Q IV: x > 0, y < 0φ = arctan(y/x) + 2π3π/2 < φ < 2πφTip: Most calculators and programming languages offer atan2(y, x) which handles all four quadrants automatically.
Each quadrant box shows the signs of x and y, the formula adjustment, and the resulting range for φ. Using atan2(y, x) eliminates the need for manual adjustments.

Special Cases to Watch For

Point (x, y, z)ρθφ
(0, 0, 0) — origin0undefinedundefined
(0, 0, 5) — positive z-axis50undefined (any value)
(0, 0, −3) — negative z-axis3πundefined (any value)
(4, 0, 0) — positive x-axis4π/20
(0, 4, 0) — positive y-axis4π/2π/2

Special-case Cartesian points and their spherical equivalents

When a point lies on the z-axis (x = 0 and y = 0), there is no meaningful rotation in the xy-plane, so φ is undefined. Convention usually sets φ = 0 in these cases. Similarly, at the origin itself, both angles are undefined because there is no direction from the origin to itself.

SECTION 6

Worked Example

Let's convert the Cartesian point (1, √3, 2) to spherical coordinates step by step.

Convert (1, √3, 2) to Spherical Coordinates

  1. 1

    Step 1 — Identify Given Values

    We are given x = 1, y = √3 ≈ 1.732, and z = 2. Our goal is to find ρ, θ, and φ.
  2. 2

    Step 2 — Find ρ (Radial Distance)

    Apply the distance formula: ρ = √(x² + y² + z²) = √(1² + (√3)² + 2²) = √(1 + 3 + 4) = √8 = 2√2.
    ρ = 2√2 ≈ 2.828
  3. 3

    Step 3 — Find θ (Polar Angle)

    Use cos θ = z / ρ = 2 / (2√2) = 1 / √2. Therefore θ = arccos(1/√2) = π/4, which equals 45°.
    θ = π/4 (45°)
  4. 4

    Step 4 — Find φ (Azimuthal Angle)

    Use tan φ = y / x = √3 / 1 = √3. Since x > 0 and y > 0 (Quadrant I), no adjustment is needed. Therefore φ = arctan(√3) = π/3, which equals 60°.
    φ = π/3 (60°)
  5. 5

    Step 5 — State the Final Answer

    The spherical coordinates are (ρ, θ, φ) = (2√2, π/4, π/3). You can verify by converting back: x = 2√2 × sin(π/4) × cos(π/3) = 2√2 × (√2/2) × (1/2) = 1 ✓
    (ρ, θ, φ) = (2√2, π/4, π/3)

SECTION 7

Cartesian vs. Cylindrical vs. Spherical

Spherical coordinates are not the only alternative to Cartesian. Cylindrical coordinates (r, θ, z) offer a middle ground. Here is a comparison of when each system shines.

FeatureCartesian (x, y, z)Cylindrical (r, θ, z)Spherical (ρ, θ, φ)
Best geometryBoxes, flat planesTubes, cylinders, cansSpheres, cones, radial fields
Coordinates3 distances2 distances + 1 angle1 distance + 2 angles
Distance formula√(x² + y² + z²)√(r² + z²)ρ (it's built in!)
Equation of a spherex² + y² + z² = R²r² + z² = R²ρ = R (one variable!)
Difficulty for beginnersLowMediumMedium–High

Side-by-side comparison of three 3D coordinate systems

✦

KEY TAKEAWAY

Choosing a coordinate system is like choosing the right tool for a job. You can measure the height of a tree with a ruler, but a laser rangefinder (distance + angle) is far more practical. Spherical coordinates are the mathematical equivalent of that rangefinder — perfect when the problem revolves around a central point.

SECTION 8

Connection to Advanced Theory

The conversion formulas you learned here are just the beginning. As you move into multivariable calculus, spherical coordinates become essential for evaluating triple integrals over spherical regions. The Jacobian factor ρ² sin θ appears whenever you change from Cartesian to spherical in an integral, accounting for the fact that spherical 'grid cells' stretch and shrink at different positions.

This LessonWhere It Leads
ρ = √(x² + y² + z²)Triple integrals with dV = ρ² sin θ dρ dθ dφ
Equation of a sphere: ρ = RSurface integrals over spherical surfaces
Angles θ and φGradient, divergence, and curl in spherical coordinates
Coordinate conversionSolving PDEs (Laplace, wave, heat) with spherical symmetry

How today's skills connect to future topics

In physics, nearly every problem involving gravity, electric fields, or wave propagation from a point source becomes dramatically simpler in spherical coordinates. If you continue to AP Physics C or college-level E&M, you will see these formulas constantly. Mastering the conversion now gives you a huge head start.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

Explain in your own words why the polar angle θ uses arccos(z/ρ) rather than arctan or arcsin. What property of arccos makes it the natural choice?
Show answer
The polar angle θ must range from 0 (the positive z-axis) to π (the negative z-axis). The function arccos has a range of exactly [0, π], which matches this requirement perfectly. In contrast, arcsin outputs values from −π/2 to π/2, and arctan outputs from −π/2 to π/2 as well, neither of which covers the full range of possible polar angles. Additionally, cos θ = z/ρ gives a unique value for every tilt between 'straight up' and 'straight down,' so no quadrant adjustment is needed.

Question 2: BASIC CALCULATION

Convert the Cartesian point (0, 3, 4) to spherical coordinates (ρ, θ, φ).
Show answer
First, find ρ = √(0² + 3² + 4²) = √(0 + 9 + 16) = √25 = 5. Next, θ = arccos(z/ρ) = arccos(4/5) ≈ 0.6435 radians ≈ 36.87°. Finally, φ = atan2(y, x) = atan2(3, 0) = π/2, since the point lies on the positive y-axis in the xy-plane. The spherical coordinates are (5, arccos(4/5), π/2).

Question 3: INTERMEDIATE

Convert the Cartesian point (−2, 2, −2√2) to spherical coordinates. Give θ and φ in exact form using inverse trig expressions or known angle values.
Show answer
Compute ρ = √((−2)² + 2² + (−2√2)²) = √(4 + 4 + 8) = √16 = 4. For θ: cos θ = z/ρ = −2√2/4 = −√2/2, so θ = arccos(−√2/2) = 3π/4 (135°). For φ: x = −2, y = 2, so the point is in Quadrant II of the xy-plane. tan φ = 2/(−2) = −1. In Quadrant II, φ = π − arctan(1) = π − π/4 = 3π/4 (or equivalently atan2(2, −2) = 3π/4). The answer is (4, 3π/4, 3π/4).

Question 4: APPLIED

A weather satellite orbits Earth and has Cartesian coordinates (in thousands of km) of (3, 4, 12) relative to Earth's center. What is the satellite's distance from Earth's center, and what are its polar and azimuthal angles in spherical coordinates?
Show answer
The distance from Earth's center is ρ = √(3² + 4² + 12²) = √(9 + 16 + 144) = √169 = 13 thousand km. The polar angle θ = arccos(12/13) ≈ 0.3948 radians ≈ 22.62°, meaning the satellite is fairly close to the 'north pole' direction. The azimuthal angle φ = atan2(4, 3) = arctan(4/3) ≈ 0.9273 radians ≈ 53.13° (Quadrant I). So the satellite is 13,000 km from Earth's center at spherical coordinates (13, arccos(12/13), arctan(4/3)).

Question 5: CRITICAL THINKING

A point has Cartesian coordinates (a, a, a) where a > 0. Express its spherical coordinates entirely in terms of a, using exact values. Then describe geometrically where all such points lie as a varies.
Show answer
For (a, a, a) with a > 0: ρ = √(a² + a² + a²) = a√3. The polar angle θ = arccos(a/(a√3)) = arccos(1/√3) ≈ 54.74°. The azimuthal angle φ = atan2(a, a) = arctan(1) = π/4 (45°). So the spherical coordinates are (a√3, arccos(1/√3), π/4). As a increases, ρ grows but the two angles remain constant. This means all such points lie on a single ray emanating from the origin — specifically the ray that makes a 45° angle in the xy-plane and tilts at arccos(1/√3) from the z-axis. This is the space diagonal of the first octant, the line x = y = z.

SUMMARY

Lesson Summary

Summary

Every point in 3D space with Cartesian coordinates (x, y, z) can be re-expressed in spherical coordinates (ρ, θ, φ). The radial distance ρ = √(x² + y² + z²) measures how far the point is from the origin. The polar angle θ = arccos(z/ρ) measures the tilt from the positive z-axis, ranging from 0 to π. The azimuthal angle φ = atan2(y, x) measures the rotation in the xy-plane from the positive x-axis, ranging from 0 to 2π.

The reverse conversion uses x = ρ sin θ cos φ, y = ρ sin θ sin φ, and z = ρ cos θ. Always watch for quadrant adjustments when computing φ, and remember that points on the z-axis have an undefined azimuthal angle. Spherical coordinates simplify any problem with radial symmetry — from computing volumes of spheres to modeling gravitational and electric fields.

Varsity Tutors • Multivariable Calculus • Cartesian to Spherical — Convert between Cartesian and spherical coordinates