Extending coordinate geometry to three dimensions with the Oxyz system.
IntuitionAdding a third axis: from the plane to Oxyz
In a room, you can locate any point — say the tip of a ceiling lamp — by three numbers: how far along one wall (x), how far along the adjacent wall (y), and how high above the floor (z). Putting three mutually perpendicular axes Ox,Oy,Oz together at the corner O gives the coordinate system Oxyz, turning every point M(x,y,z), every direction, and every flat or curved surface in space into numbers and equations.
Interactive 3D surface plot in $Oxyz$ coordinates.
A surface z=f(x,y) plotted in the Oxyz coordinate system. Change the function choice and vertical scale to see how an equation between x,y,z carves out a shape in space.
SchoolVectors, planes, lines and spheres in coordinates
Definition: Dot product and cross product (u×v)
For two space vectors u=(u1,u2,u3) and v=(v1,v2,v3), the dot product is the number u⋅v=u1v1+u2v2+u3v3 (which is 0 exactly when u⊥v), while the cross product u×v is a new vector perpendicular to both u and v:
u×v=(u2v3−u3v2,u3v1−u1v3,u1v2−u2v1)
The length ∣u×v∣ equals the area of the parallelogram spanned by u and v, and u×v=0 when the two vectors are collinear. This makes u×v the standard tool for building a normal vector to a plane from two directions lying in that plane.
Definition: Plane, line and sphere in space
A plane (P) with nonzero normal vector n=(A,B,C) has general equation Ax+By+Cz+D=0. A line through M0(x0,y0,z0) with direction vector u=(a,b,c) is written in parametric form x=x0+at,y=y0+bt,z=z0+ct (t∈R) or canonical form ax−x0=by−y0=cz−z0 (when a,b,c=0). A sphere with center I(x0,y0,z0) and radius R>0 has equation (x−x0)2+(y−y0)2+(z−z0)2=R2.
Ax+By+Cz+D=0
Distances in Oxyz come directly from the Pythagorean theorem and orthogonal projection: the distance between two points A,B is AB=(xB−xA)2+(yB−yA)2+(zB−zA)2, and the perpendicular distance from a point M0(x0,y0,z0) to the plane Ax+By+Cz+D=0 is given by:
d(M0,(P))=A2+B2+C2∣Ax0+By0+Cz0+D∣
Summary of objects and equations in Oxyz
Object
Defining vector / data
Equation / formula
Plane
Normal vector n=(A,B,C)
Ax+By+Cz+D=0
Line
Point M0, direction u=(a,b,c)
x=x0+at,y=y0+bt,z=z0+ct
Sphere
Center I(x0,y0,z0), radius R
(x−x0)2+(y−y0)2+(z−z0)2=R2
Point-to-plane distance
M0(x0,y0,z0) and n=(A,B,C)
d(M0,(P))=A2+B2+C2∣Ax0+By0+Cz0+D∣
UndergraduateTheorems: cross product and distance from a point to a plane
In Oxyz, the perpendicular distance from M0(x0,y0,z0) to the plane (P):Ax+By+Cz+D=0 (with A2+B2+C2>0) is d(M0,(P))=A2+B2+C2∣Ax0+By0+Cz0+D∣.
Why is it true?
Evaluating Ax0+By0+Cz0+D measures how far M0 fails to satisfy the plane's equation, scaled by the length ∣n∣=A2+B2+C2 of the normal vector n=(A,B,C). Dividing by ∣n∣ converts that algebraic residual into the true geometric distance along the normal direction.
Proof
Pick any point M1(x1,y1,z1) on the plane (P). Because M1 lies on (P), its coordinates satisfy Ax1 + By1 + Cz1 + D = 0, so D = -(Ax1 + By1 + Cz1).
Let H be the orthogonal projection of M0 onto (P). The vector M1M0 = (x0-x1, y0-y1, z0-z1) decomposes into a component along the plane plus the normal component HM0, so the distance d(M0,(P)) = |HM0| is the absolute value of the scalar projection of M1M0 onto the normal vector n = (A,B,C).
That scalar projection has magnitude |n . M1M0| / |n| = |A(x0-x1) + B(y0-y1) + C(z0-z1)| / sqrt(A^2+B^2+C^2).
Replacing -(Ax1 + By1 + Cz1) with D inside the absolute value yields |Ax0 + By0 + Cz0 + D| / sqrt(A^2+B^2+C^2), completing the proof.
For any u=(u1,u2,u3) and v=(v1,v2,v3), the cross product u×v=(u2v3−u3v2,u3v1−u1v3,u1v2−u2v1) satisfies (u×v)⋅u=0, (u×v)⋅v=0, and ∣u×v∣2=∣u∣2∣v∣2−(u⋅v)2.
Why is it true?
The first two equations confirm that u×v is perpendicular to both input vectors, so it gives a ready-made normal vector to any plane spanned by u and v. The third equation rewrites as ∣u×v∣=∣u∣∣v∣sinθ, the base-times-height area of the parallelogram spanned by u and v.
Proof
Compute the dot product directly from the coordinate definitions: (u x v) . u = (u2 v3 - u3 v2) u1 + (u3 v1 - u1 v3) u2 + (u1 v2 - u2 v1) u3.
Expanding the three products gives u1 u2 v3 - u1 u3 v2 + u2 u3 v1 - u1 u2 v3 + u1 u3 v2 - u2 u3 v1 = 0, since the six terms cancel in pairs. The calculation for (u x v) . v = 0 is identical.
For the magnitude identity, expand |u x v|^2 = (u2 v3 - u3 v2)^2 + (u3 v1 - u1 v3)^2 + (u1 v2 - u2 v1)^2. Meanwhile, expand |u|^2 |v|^2 - (u . v)^2 = (u1^2+u2^2+u3^2)(v1^2+v2^2+v3^2) - (u1 v1 + u2 v2 + u3 v3)^2.
In the second expression the diagonal terms u1^2 v1^2, u2^2 v2^2, u3^2 v3^2 cancel, leaving the exact same six off-diagonal terms u_i^2 v_j^2 - 2 u_i u_j v_i v_j as in the expansion of |u x v|^2. Since u . v = |u||v|cos(theta), this equals |u|^2|v|^2(1 - cos^2(theta)) = (|u||v|sin(theta))^2.
UndergraduateReal-World Applications and Worked Examples
Every 3D graphics engine, CAD program, robot arm controller and satellite navigation receiver works inside an Oxyz coordinate frame. A triangle mesh on a screen is lit by computing the cross product u×v of two edge vectors of each triangle to get its unit normal n=(A,B,C), then taking the dot product with the light direction. Collision detection and drone obstacle clearance reduce to checking the point-to-plane distance d(M0,(P))=A2+B2+C2∣Ax0+By0+Cz0+D∣ and the sphere equation (x−x0)2+(y−y0)2+(z−z0)2=R2; satellite positioning (GPS) intersects spheres centered at satellites of known Oxyz coordinates.
Example: Plane equation through three points using the cross product
Find the equation of the plane (P) passing through the three points A(1,0,0), B(0,2,0) and C(0,0,2).
Solution
Form two vectors lying in the plane: AB = (-1, 2, 0) and AC = (-1, 0, 2).
Their cross product gives a normal vector to (P): AB x AC = (22 - 00, 0(-1) - (-1)2, (-1)0 - 2(-1)) = (4, 2, 2). We can divide by 2 and use the simpler normal vector n = (2, 1, 1).
Writing 2(x - 1) + 1(y - 0) + 1(z - 0) = 0 through the point A(1,0,0) gives the plane equation 2x + y + z - 2 = 0.
Example: Clearance distance from a drone to a slanted roof plane
In a local Oxyz frame (in meters), a slanted roof lies in the plane (P):2x−2y+z−5=0, and a hovering drone is at M0(3,1,4). Find the perpendicular clearance distance from the drone to the roof, and the equation of the largest sphere centered at M0 that does not cross the roof.
Solution
Using d(M0,(P))=A2+B2+C2∣Ax0+By0+Cz0+D∣ with (A,B,C)=(2,−2,1) and M0(3,1,4), the numerator is ∣2(3)−2(1)+1(4)−5∣=∣6−2+4−5∣=3.
The denominator is 22+(−2)2+12=9=3, so the clearance distance is d(M0,(P))=3/3=1 meter.
The largest sphere around M0 that stays clear of the roof is tangent to (P), so its radius is R=d(M0,(P))=1. By (x−x0)2+(y−y0)2+(z−z0)2=R2, its equation is (x−3)2+(y−1)2+(z−4)2=1.
In Oxyz, what is the cross product u×v of u=(1,2,0) and v=(0,1,3)?
Which vector below is a normal vector to the plane 3x−y+4z−7=0?
What are the center I and radius R of the sphere (x−1)2+(y+2)2+z2=9?
A 3D graphics engine needs a normal vector to shade a triangular face with vertices A,B,C. Which operation on the edge vectors u=AB and v=AC produces a vector perpendicular to the triangle?