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.

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.

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.

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.

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.

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
ρ = √(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 / √(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) (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 θ
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.

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.

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

Special-case Cartesian points and their spherical equivalents
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

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.

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
Step 1 — Identify Given ValuesWe are given x = 1, y = √3 ≈ 1.732, and z = 2. Our goal is to find ρ, θ, and φ.
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
Step 3 — Find θ (Polar Angle)Use cos θ = z / ρ = 2 / (2√2) = 1 / √2. Therefore θ = arccos(1/√2) = π/4, which equals 45°.
θ = π/4 (45°)
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
Step 5 — State the Final AnswerThe 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)

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.

Side-by-side comparison of three 3D coordinate systems
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
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.

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.

How today's skills connect to future topics
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

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.

Practice Problems

PROBLEM 1CONCEPTUAL
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?
PROBLEM 2BASIC CALCULATION
Convert the Cartesian point (0, 3, 4) to spherical coordinates (ρ, θ, φ).
PROBLEM 3INTERMEDIATE
Convert the Cartesian point (−2, 2, −2√2) to spherical coordinates. Give θ and φ in exact form using inverse trig expressions or known angle values.
PROBLEM 4APPLIED
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?
PROBLEM 5CRITICAL 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.

Lesson 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