Learning Objectives
By the end of this section, you will be able to:
- Understand the geometric meaning of cylindrical coordinates and when they simplify problems
- Understand the geometric meaning of spherical coordinates and their relationship to latitude/longitude
- Convert between Cartesian, cylindrical, and spherical coordinate systems
- Derive the volume elements (Jacobians) for cylindrical and spherical coordinates
- Apply these coordinate systems to simplify integration problems
- Recognize applications in physics, engineering, and machine learning
The Big Picture: Beyond Cartesian Coordinates
"The art of choosing the right coordinate system is the art of making the impossible tractable." — Mathematical Wisdom
Cartesian coordinates are powerful and intuitive, but they are not always the best choice. Many natural objects and physical phenomena exhibit symmetry that Cartesian coordinates cannot easily capture:
- Cylinders, pipes, and towers have circular cross-sections and vertical axes
- Spheres, planets, and atoms are naturally described by distance from a center
- Rotation problems involve angles rather than linear displacements
- Wave propagation often spreads radially from a source
The Key Insight
The right coordinate system matches the symmetry of your problem. A sphere described in Cartesian coordinates requires the equation . In spherical coordinates, the same sphere is simply — a single constant! This simplification makes integration, differentiation, and visualization dramatically easier.
This section introduces two essential coordinate systems that complement Cartesian coordinates:
| Coordinate System | Best For | Key Variables |
|---|---|---|
| Cartesian (x, y, z) | Rectangular regions, linear problems | x, y, z (distances along axes) |
| Cylindrical (r, θ, z) | Cylinders, pipes, axial symmetry | r (radial), θ (angular), z (height) |
| Spherical (ρ, θ, φ) | Spheres, radial symmetry, 3D angles | ρ (distance), θ (azimuth), φ (polar) |
Historical Origins: The Evolution of Coordinate Systems
The development of non-Cartesian coordinate systems arose from practical needs in astronomy, physics, and engineering.
Ancient Astronomy and Celestial Coordinates
Long before René Descartes formalized Cartesian coordinates in 1637, astronomers used spherical-like systems to map the heavens. The celestial sphere — an imaginary sphere surrounding Earth — was described using:
- Declination: Angle above or below the celestial equator (like latitude)
- Right Ascension: Angle along the celestial equator (like longitude)
This is essentially a spherical coordinate system with Earth at the center.
Newton and Gravitational Fields (1687)
Isaac Newton's law of gravitation describes force as inversely proportional to the square of distance: . This radial dependence makes spherical coordinates natural for gravitational problems. Newton himself used geometric arguments that implicitly relied on spherical symmetry.
Euler and the Formalization (1750s)
Leonhard Euler systematically developed the mathematical framework for cylindrical and spherical coordinates, including:
- Explicit conversion formulas between coordinate systems
- Expressions for arc length, area, and volume elements
- Methods for transforming differential equations
Laplace and Potential Theory (1785)
Pierre-Simon Laplace expressed his famous equation in spherical coordinates, enabling solutions for gravitational and electrostatic potentials around spherical bodies. This became foundational for mathematical physics.
Cylindrical Coordinates
Cylindrical coordinates extend polar coordinates into three dimensions by adding a height coordinate . A point is specified by three values:
Cylindrical Coordinates
- : The radial distance from the z-axis to the point (in the xy-plane). Range:
- : The angle from the positive x-axis, measured counterclockwise in the xy-plane. Range:
- : The height above (or below) the xy-plane. Range:
Drag to rotate the view
Cylindrical Coordinates (r, \u03B8, z)
Cartesian Equivalent
x = r cos(\u03B8) = 1.414
y = r sin(\u03B8) = 1.414
z = 1.500
Key Insight
Cylindrical coordinates extend polar coordinates into 3D by adding a height z. The point lies on a cylinder of radius r, at angle \u03B8 from the positive x-axis, and height z above the xy-plane.
Conversion Formulas: Cylindrical ↔ Cartesian
Cylindrical → Cartesian
Cartesian → Cylindrical
(with quadrant correction)
Using arctan2 for θ
The standard only gives angles in . To get the correct angle in all four quadrants, use the atan2(y, x) function available in most programming languages. This function considers the signs of both x and y to determine the correct quadrant.
Geometric Interpretation
Think of cylindrical coordinates as describing a point by:
- How far is it from the central axis (the z-axis)? This is .
- In what direction around the axis? This is .
- How high up or down? This is .
The name "cylindrical" comes from the fact that surfaces of constant are cylinders centered on the z-axis.
Spherical Coordinates
Spherical coordinates describe a point by its distance from the origin and two angles. This system is ideal for problems with radial symmetry.
Spherical Coordinates
- (rho): The radial distance from the origin to the point. Range:
- (theta): The azimuthal angle in the xy-plane from the positive x-axis. Range:
- (phi): The polar angle from the positive z-axis. Range:
Drag to rotate the view
Spherical Coordinates (\u03C1, \u03B8, \u03C6)
Cartesian Equivalent
x = \u03C1 sin(\u03C6) cos(\u03B8) = 1.531
y = \u03C1 sin(\u03C6) sin(\u03B8) = 1.531
z = \u03C1 cos(\u03C6) = 1.250
Key Insight
The point lies on a sphere of radius \u03C1 centered at the origin. \u03B8 determines the "longitude" (angle in xy-plane from x-axis), while \u03C6 determines the "latitude" (angle down from the north pole/z-axis).
Convention Alert
Different textbooks and fields use different conventions for spherical coordinates. In physics, is often the azimuthal angle and is the polar angle — the opposite of our convention. Always check which convention is being used!
Conversion Formulas: Spherical ↔ Cartesian
Spherical → Cartesian
Cartesian → Spherical
Understanding the Angles
The two angles in spherical coordinates have distinct roles:
- (azimuthal angle): Like longitude on Earth, this angle sweeps around the z-axis in the xy-plane. It determines the "compass direction."
- (polar angle): Like colatitude (90° - latitude), this angle measures how far "down" from the north pole (positive z-axis) the point is. is the north pole, is the equator, and is the south pole.
Earth Coordinates Comparison
Geographic coordinates use latitude (measured from the equator, ±90°) instead of the polar angle φ (measured from the north pole, 0 to 180°). The relationship is: .
Conversion Formulas
Use this interactive calculator to convert between all three coordinate systems:
Cartesian (x, y, z)
Cylindrical (r, \u03B8, z)
r = 1.414
\u03B8 = 45.000\u00B0
z = 1.000
r = \u221A(x\u00B2 + y\u00B2)
\u03B8 = atan2(y, x)
z = z
Spherical (\u03C1, \u03B8, \u03C6)
\u03C1 = 1.732
\u03B8 = 45.000\u00B0
\u03C6 = 54.736\u00B0
\u03C1 = \u221A(x\u00B2 + y\u00B2 + z\u00B2)
\u03B8 = atan2(y, x)
\u03C6 = arccos(z/\u03C1)
Cylindrical ↔ Spherical Conversions
Sometimes you need to convert directly between cylindrical and spherical coordinates:
Cylindrical → Spherical
(unchanged)
Spherical → Cylindrical
(unchanged)
Notice that is the same in both systems — both measure the angle in the xy-plane from the positive x-axis.
Volume Elements and Jacobians
When changing coordinates in an integral, we must account for how the coordinate transformation stretches or compresses space. This is captured by the Jacobian.
Cylindrical Coordinates: dV = r dr dθ dz
In cylindrical coordinates, the volume element is:
The factor of appears because:
- A small change sweeps out an arc of length
- Near the z-axis (), this arc is tiny
- Far from the z-axis, the same covers more space
Spherical Coordinates: dV = ρ² sin(φ) dρ dθ dφ
In spherical coordinates, the volume element is:
This Jacobian has two factors:
- : Spherical shells have area proportional to (surface area of sphere = )
- : Circles of latitude shrink near the poles. At (north pole), the circumference is zero; at (equator), it's maximum.
Why the Jacobian Matters
Forgetting the Jacobian is one of the most common errors in multivariable calculus. When you change variables in an integral, you must multiply by the absolute value of the Jacobian determinant. For our standard coordinate systems:
- Cartesian:
- Cylindrical:
- Spherical:
Real-World Applications
V = \u222B\u222B\u222B r dr d\u03B8 dz = \u03C0r\u00B2h = 14.137
Volume Integration in Cylindrical Coordinates
Cylindrical coordinates are ideal for integrating over cylindrical regions. The volume element is:
The factor of r appears because as r increases, the arc length for a given d\u03B8 also increases. This is the Jacobian of the transformation.
Applications: Pipes, tanks, magnetic fields around wires, heat distribution in rods, fluid flow in tubes.
When to Use Each Coordinate System
| Problem Type | Best Coordinates | Why |
|---|---|---|
| Cylinder, pipe, wire | Cylindrical | r = constant defines cylinders |
| Sphere, planet, atom | Spherical | ρ = constant defines spheres |
| Rotation around z-axis | Cylindrical | θ captures rotational symmetry |
| Radial force (gravity) | Spherical | Force depends only on ρ |
| Helical motion | Cylindrical | Combines rotation (θ) with height (z) |
| Rectangular box | Cartesian | Boundaries align with axes |
Physics Applications
Many fundamental equations of physics simplify dramatically in the right coordinates:
- Electric field of a charged wire: Cylindrical coordinates, field depends only on
- Gravitational field of a planet: Spherical coordinates, field depends only on
- Schrödinger equation for hydrogen: Spherical coordinates allow separation of variables, yielding the famous atomic orbitals
- Fluid flow in a pipe: Cylindrical coordinates capture the parabolic velocity profile
Machine Learning Applications
Coordinate systems and their transformations appear throughout modern machine learning:
1. Hyperspherical Coordinates in High Dimensions
Spherical coordinates generalize to n dimensions as hyperspherical coordinates. These are crucial for:
- Uniform sampling on hyperspheres: Many ML algorithms need to sample uniformly from the surface of a hypersphere (e.g., for weight initialization)
- Directional statistics: When data lies on a sphere (text embeddings, normalized features), spherical coordinates provide natural distributions
- von Mises-Fisher distribution: The spherical analog of the Gaussian, used in clustering on spheres
2. Normalizing Flows and Coordinate Transforms
Normalizing flows transform simple distributions into complex ones using invertible mappings. The key insight is tracking the Jacobian:
This is exactly the change-of-variables formula from multivariable calculus! Polar/spherical transforms inspired many flow architectures.
3. 3D Computer Vision and Graphics
Modern 3D deep learning heavily uses coordinate systems:
- Point cloud processing: Converting between Cartesian and spherical representations for different tasks
- NeRF (Neural Radiance Fields): Ray marching uses parametric coordinates
- Spherical CNNs: Convolutions on spherical data (climate, planetary) require understanding spherical geometry
4. Positional Encodings
The sinusoidal positional encodings in Transformers:
PE(pos, 2i) = sin(pos / 10000^(2i/d))
PE(pos, 2i+1) = cos(pos / 10000^(2i/d))
These are essentially polar coordinates! The position is encoded as angles at different frequencies, allowing the model to learn relative positions through rotation-like operations.
Python Implementation
Coordinate Conversion Functions
Integration Example: Comparing Coordinate Systems
Common Pitfalls
Forgetting the Jacobian
When converting an integral to cylindrical or spherical coordinates, you must include the appropriate Jacobian factor:
- Cylindrical:
- Spherical:
Angle Ranges
Be careful with angle ranges:
- ranges from to (full circle)
- ranges from to (half circle, pole to pole)
Integrating from 0 to would double-count the sphere!
Convention Differences
Physics and mathematics often use opposite conventions for and in spherical coordinates. Some texts use instead of . Always check the definitions!
Cylindrical r vs. Spherical ρ
Don't confuse cylindrical (distance from z-axis) with spherical (distance from origin). They are related by .
Test Your Understanding
In cylindrical coordinates (r, θ, z), what does the coordinate r represent?
Summary
Cylindrical and spherical coordinates are powerful tools for problems with rotational or radial symmetry. They transform complex boundaries into simple constants and make otherwise intractable integrals manageable.
Key Formulas
| Coordinate System | Point | Volume Element |
|---|---|---|
| Cartesian | (x, y, z) | dx dy dz |
| Cylindrical | (r, θ, z) | r dr dθ dz |
| Spherical | (ρ, θ, φ) | ρ² sin(φ) dρ dθ dφ |
Key Takeaways
- Cylindrical coordinates extend polar coordinates to 3D and are ideal for cylinders and axial symmetry
- Spherical coordinates describe points by distance and two angles, perfect for spheres and radial symmetry
- The Jacobian accounts for how coordinate transformations stretch or compress space — never forget it in integrals!
- Choose coordinates that match your problem's symmetry: a sphere is in spherical but in Cartesian
- These concepts extend to machine learning through hyperspherical geometry, normalizing flows, and 3D computer vision
Coming Next: In the next chapter, we'll explore Vector-Valued Functions, learning how to describe curves and motion in three-dimensional space using vectors that change with a parameter.