Learning Objectives
By the end of this section, you will be able to:
- Describe the three-dimensional rectangular coordinate system and understand its relationship to the 2D Cartesian plane
- Plot points in 3D space and interpret ordered triples
- Calculate distances between points in 3D using the distance formula
- Find midpoints of line segments in three-dimensional space
- Write equations of spheres and identify their centers and radii
- Identify coordinate planes, axes, and octants in 3D space
- Connect 3D coordinates to applications in physics, computer graphics, and machine learning
The Big Picture: Why Three Dimensions?
"Space is three-dimensional. We live in three dimensions, and to describe the world accurately, mathematics must embrace all three." — Adapted from various mathematical traditions
We live in a three-dimensional world. When you describe the location of a coffee cup on your desk, you might say it's 30 cm from the left edge, 20 cm from the front edge, and sitting on the surface (0 cm above the desk). You've just used three coordinates.
Two-dimensional calculus — with its coordinates — works beautifully for flat problems: curves in a plane, areas, and functions of one variable. But the physical world demands more:
🌍 Physical World
- Position of an airplane (latitude, longitude, altitude)
- Motion of planets in space
- Electric and magnetic fields
- Fluid flow in pipes and atmosphere
💻 Computer Science
- 3D graphics and game engines
- Computer vision and robotics
- CAD/CAM design software
- Virtual and augmented reality
🧬 Sciences
- Molecular structure in chemistry
- Brain imaging and medical scans
- Geological mapping
- Weather modeling
🤖 Machine Learning
- Feature spaces (often many dimensions!)
- Data visualization and clustering
- Neural network weight spaces
- Embedding spaces for NLP
Beyond 3D
While we focus on 3D here, the same principles extend to n-dimensional space. In machine learning, we routinely work with hundreds or thousands of dimensions. Understanding 3D deeply provides the intuition for these higher-dimensional spaces.
Historical Origins: From Descartes to Modern 3D
The rectangular coordinate system bears the name of René Descartes (1596–1650), the French philosopher and mathematician who revolutionized mathematics by connecting algebra and geometry. His insight was profound: geometric shapes can be described by equations, and equations can be visualized as shapes.
Descartes' Revolutionary Idea
In his 1637 work La Géométrie, Descartes showed that a point in a plane could be uniquely identified by two numbers — its horizontal and vertical distances from a reference point. This "Cartesian" coordinate system unified algebra and geometry, transforming how we understand mathematics.
The extension to three dimensions was natural but took time to develop fully. Mathematicians including Pierre de Fermat, Leonhard Euler, and Joseph-Louis Lagrange contributed to establishing 3D analytic geometry in the 17th and 18th centuries.
Why 'Rectangular'?
The 3D coordinate system is called "rectangular" (or "Cartesian") because the three axes meet at right angles (90°). This creates a grid of rectangular boxes that partition space. Later, we'll learn other coordinate systems (cylindrical, spherical) that are better suited for certain problems.
The Three-Dimensional Rectangular Coordinate System
To locate points in 3D space, we extend the familiar 2D Cartesian plane by adding a third axis perpendicular to both the -axis and the -axis.
The Three Axes
The Right-Hand Rule Orientation
The three coordinate axes are labeled , , and . They follow the right-hand rule:
- Point your right hand's fingers along the positive -axis
- Curl your fingers toward the positive -axis
- Your thumb points in the direction of the positive -axis
| Axis | Common Convention | Physical Interpretation |
|---|---|---|
| x-axis | Points right (or forward) | Width, left-right position |
| y-axis | Points forward (or up) | Depth, forward-backward position |
| z-axis | Points up (or out of screen) | Height, up-down position |
Convention Varies by Field
Different fields use different conventions! In mathematics and physics, is typically vertical (up). In computer graphics, is often vertical. Always check the convention in use.
Ordered Triples
Every point in 3D space is represented by an ordered triple:
where is the horizontal distance from the -plane, is the distance from the -plane, and is the distance from the -plane.
Interactive: Explore the 3D Coordinate System
Use the interactive visualization below to explore how 3D coordinates work. Drag the point to see how its coordinates change, and observe how the perpendicular projections to each plane help locate the point.
Plotting Points in 3D Space
To plot a point in 3D:
- Start at the origin
- Move units along the -axis
- Move units parallel to the -axis
- Move units parallel to the -axis
Examples of Plotting Points
| Point | x-direction | y-direction | z-direction | Location Description |
|---|---|---|---|---|
| (3, 2, 4) | Right 3 | Forward 2 | Up 4 | In front, right, above origin |
| (-1, 4, 2) | Left 1 | Forward 4 | Up 2 | In front, left, above origin |
| (2, -3, 5) | Right 2 | Backward 3 | Up 5 | Behind, right, above origin |
| (0, 0, 5) | None | None | Up 5 | Directly above origin on z-axis |
| (4, 3, 0) | Right 4 | Forward 3 | None | In the xy-plane |
Special Points
The origin is where all three axes intersect. Points on an axis have two zero coordinates (e.g., lies on the -axis).
Distance Formula in 3D
The distance between two points in 3D is a natural extension of the 2D Pythagorean theorem. Just as the 2D distance comes from a right triangle, the 3D distance comes from a rectangular box.
Derivation from the Pythagorean Theorem
Consider two points and :
- First, find the distance in the -plane:
- Then, use this as one leg of a right triangle with the -difference as the other leg
- Apply Pythagorean theorem again:
Distance Formula in 3D
The distance between points and is:
Example: Computing Distance
Find the distance between and .
Solution:
Notice that since the -coordinates are equal, the points lie in a plane parallel to the -plane, and the distance reduces to the 2D formula.
Interactive: Explore Distance in 3D
Midpoint Formula in 3D
The midpoint of a line segment is the point exactly halfway between the endpoints. In 3D, we simply average each coordinate.
Midpoint Formula in 3D
The midpoint of the segment from to is:
Example: Finding a Midpoint
Find the midpoint of the segment from to .
Solution:
Equations of Spheres
A sphere is the set of all points in 3D space that are a fixed distance (the radius) from a fixed point (the center). This is the 3D analog of a circle in 2D.
Standard Equation of a Sphere
Standard Form of a Sphere
A sphere with center and radius has the equation:
This equation directly comes from the distance formula: a point is on the sphere if and only if its distance from the center equals the radius.
Example: Writing Sphere Equations
Write the equation of a sphere with center and radius .
Solution:
General Form of a Sphere
Expanding the standard form gives the general form:
To convert from general to standard form, we complete the square for each variable.
Example: Converting General to Standard Form
Find the center and radius of the sphere:
Solution: Group terms and complete the square:
Center: , Radius:
Interactive: Explore Spheres in 3D
Coordinate Planes and Octants
The Three Coordinate Planes
The three axes define three coordinate planes that divide 3D space into regions:
| Plane | Equation | Points on This Plane | Description |
|---|---|---|---|
| xy-plane | z = 0 | (x, y, 0) | Horizontal plane through origin |
| xz-plane | y = 0 | (x, 0, z) | Vertical plane (front-back) |
| yz-plane | x = 0 | (0, y, z) | Vertical plane (side-to-side) |
The Eight Octants
Just as the 2D coordinate system has four quadrants, the 3D coordinate system has eight octants. The first octant is where all three coordinates are positive.
| Octant | x | y | z | Example Point |
|---|---|---|---|---|
| First (I) | + | + | + | (1, 2, 3) |
| Second (II) | - | + | + | (-1, 2, 3) |
| Third (III) | - | - | + | (-1, -2, 3) |
| Fourth (IV) | + | - | + | (1, -2, 3) |
| Fifth (V) | + | + | - | (1, 2, -3) |
| Sixth (VI) | - | + | - | (-1, 2, -3) |
| Seventh (VII) | - | - | - | (-1, -2, -3) |
| Eighth (VIII) | + | - | - | (1, -2, -3) |
Remember the First Octant
The first octant (where , , ) is analogous to the first quadrant in 2D. Most applications focus on this octant for simplicity.
Surfaces in 3D
In 2D, an equation like describes a curve (a circle). In 3D, similar equations describe surfaces.
Planes Parallel to Coordinate Planes
| Equation | Surface | Description |
|---|---|---|
| z = k | Horizontal plane | All points at height k |
| x = k | Vertical plane parallel to yz-plane | All points with x = k |
| y = k | Vertical plane parallel to xz-plane | All points with y = k |
Cylinders
A cylinder in 3D is a surface generated by moving a curve along a line parallel to one of the axes. When an equation is missing one variable, it represents a cylinder.
| Equation | Surface | Description |
|---|---|---|
| x² + y² = r² | Circular cylinder | Circle in xy-plane extended along z-axis |
| y² + z² = r² | Circular cylinder | Circle in yz-plane extended along x-axis |
| x² = 4y | Parabolic cylinder | Parabola in xy-plane extended along z-axis |
Why 'Cylinder'?
The term "cylinder" in 3D calculus is broader than the everyday meaning. Any surface formed by extending a 2D curve infinitely in one direction is called a cylinder — not just circular ones.
Real-World Applications
1. GPS and Navigation
GPS uses a 3D coordinate system (actually, a spherical one wrapped around Earth) to pinpoint your location. Your phone receives signals from satellites and uses the 3D distance formula to triangulate your position.
2. Computer Graphics and Gaming
Every 3D video game and animated movie uses 3D coordinates. Objects are defined by vertices (points in 3D space), and transformations like rotation, scaling, and translation are applied using coordinate geometry.
3. Physics and Engineering
- Mechanics: Position, velocity, and acceleration are 3D vectors
- Electromagnetism: Electric and magnetic fields are defined at every point in 3D space
- Structural engineering: Forces and stresses are analyzed in 3D
4. Medical Imaging
CT scans and MRI create 3D images of the body. Each pixel (or "voxel" in 3D) has coordinates and an intensity value representing tissue density.
Machine Learning Applications
Three-dimensional coordinates and the distance formula are fundamental to many machine learning algorithms, even when working in higher dimensions.
Feature Spaces
In ML, data is often represented in a feature space where each feature is a dimension. A 3-feature dataset places each sample at a point in 3D space.
K-Nearest Neighbors (KNN)
KNN classification uses the Euclidean distance formula to find the closest training points to a new sample. It literally asks: "What are the k nearest neighbors in feature space?"
Clustering Algorithms
Algorithms like K-Means use distance calculations to group similar data points. The "cluster center" is the centroid (average position) of all points in the cluster.
Neural Network Embeddings
Modern NLP models (like word2vec, BERT) map words to vectors in high-dimensional space. Similar words are close together in this space — measured by Euclidean or cosine distance.
Higher Dimensions
While we visualize 3D easily, ML often works with 100s or 1000s of dimensions. The same formulas apply:
Understanding 3D provides the intuition; the mathematics generalizes naturally to any dimension.
Python Implementation
Basic 3D Distance and Midpoint
Spheres in 3D
Machine Learning: Distance in Feature Space
Test Your Understanding
Summary
The three-dimensional coordinate system extends our familiar 2D geometry into the space we actually live in. Understanding 3D coordinates is essential for multivariable calculus and has countless applications in physics, engineering, computer graphics, and machine learning.
Key Concepts
| Concept | Formula/Description |
|---|---|
| Point in 3D | (x, y, z) — ordered triple |
| Distance Formula | d = √[(x₂-x₁)² + (y₂-y₁)² + (z₂-z₁)²] |
| Midpoint Formula | M = ((x₁+x₂)/2, (y₁+y₂)/2, (z₁+z₂)/2) |
| Sphere (standard) | (x-h)² + (y-k)² + (z-l)² = r² |
| Coordinate Planes | xy-plane (z=0), xz-plane (y=0), yz-plane (x=0) |
| Octants | 8 regions created by the coordinate planes |
Key Takeaways
- The 3D coordinate system uses three perpendicular axes that meet at the origin, following the right-hand rule convention
- Every point is uniquely identified by an ordered triple
- The distance formula extends the Pythagorean theorem to three dimensions
- A sphere is the set of all points at a fixed distance from a center
- The three coordinate planes divide space into eight octants
- These 3D concepts extend naturally to higher dimensions used in machine learning
Coming Next: In the next section, we'll introduce vectors — mathematical objects that have both magnitude and direction. Vectors are the language of physics and the foundation of linear algebra, essential for understanding forces, velocities, and gradients in machine learning.