Unit 8, lesson 100

3D Coordinate Systems and Distance Formula

How three perpendicular axes give every point in space an ordered triple, how the coordinate planes split space into octants, and how to find distances, midpoints and the equation of a sphere.

  • Theory part 199
  • Practice part 200
  • Three Dimensions

A point on a map needs two numbers, but a drone hovering over that point needs a third, its height. Adding one axis that points straight up turns the coordinate plane into a coordinate system for space. Most of what you know about the plane carries over, and the distance formula picks up just one more term.

Key terms

Three-dimensional space and coordinates

Definition A three-dimensional rectangular coordinate system consists of a point OO, the origin, and three mutually perpendicular number lines through OO, the xx-, yy- and zz-axes, each with its zero at OO and all with the same unit of length. The axes follow the right-hand rule. When the fingers of your right hand curl from the positive xx-axis toward the positive yy-axis, your thumb points along the positive zz-axis. Each point PP in space then corresponds to exactly one ordered triple (a,b,c)(a, b, c) of real numbers, its coordinates. Here aa, bb and cc are the positions on the xx-, yy- and zz-axes of the feet of the perpendiculars dropped from PP to those axes. Conversely, each ordered triple names exactly one point. The set of all ordered triples of real numbers is written R3\mathbb{R}^3.

In plain words Lay the familiar xyxy-plane flat like a floor and stand a third axis straight up from the origin. A point is located by how far to go in each of the three axis directions.

Example To plot (2,3,4)(2, 3, 4), start at the origin, go 22 units along the xx-axis and then 33 units in the yy direction to reach the floor point (2,3,0)(2, 3, 0), then go 44 units straight up. The point (2,3,−4)(2, 3, -4) sits directly below the same floor point, 44 units under the floor.

Coordinate planes and projections

Definition The coordinate planes are the xyxy-plane, where z=0z = 0, the yzyz-plane, where x=0x = 0, and the xzxz-plane, where y=0y = 0. In space a single equation such as z=0z = 0 or y=4y = 4 describes a whole plane, not a line. The projection of P=(a,b,c)P = (a, b, c) onto the xyxy-plane is the point (a,b,0)(a, b, 0) directly below or above PP, or PP itself when c=0c = 0. Likewise its projections onto the yzyz-plane and the xzxz-plane are (0,b,c)(0, b, c) and (a,0,c)(a, 0, c). The distance from PP to the xyxy-plane is ∣c∣\lvert c \rvert, to the yzyz-plane it is ∣a∣\lvert a \rvert, and to the xzxz-plane it is ∣b∣\lvert b \rvert.

In plain words Projecting onto a coordinate plane means setting one coordinate to zero, like the shadow of a point on the floor or on a wall. The coordinate you dropped tells you how far the point is from that plane.

Example For P=(3,4,12)P = (3, 4, 12) the three projections are

(3,4,0),(0,4,12),(3,0,12).\begin{gathered} (3, 4, 0), \\[0.4em] (0, 4, 12), \\[0.4em] (3, 0, 12). \end{gathered}

The point is 1212 units above the floor, and its shadow (3,4,0)(3, 4, 0) is 32+42=5\sqrt{3^2 + 4^2} = 5 units from the origin.

Octants

Definition The three coordinate planes divide the rest of space into eight regions called octants, one for each choice of signs of the three coordinates. The first octant is the region where x>0x > 0, y>0y > 0 and z>0z > 0. There is no standard numbering of the other seven, so they are described by their signs. A point with a zero coordinate lies on a coordinate plane and belongs to no octant.

In plain words Two axes split the plane into four quadrants. Three coordinate planes split space into eight octants, four above the floor and four below it.

Example The point (2,−5,1)(2, -5, 1) is in the octant where x>0x > 0, y<0y < 0 and z>0z > 0, above the floor. The point (−1,−1,−1)(-1, -1, -1) is in the octant where all three coordinates are negative, the one opposite the first octant. The point (0,3,−2)(0, 3, -2) lies on the yzyz-plane, so it is in no octant.

Distance formula in three dimensions

Definition The distance between the points P1=(x1,y1,z1)P_1 = (x_1, y_1, z_1) and P2=(x2,y2,z2)P_2 = (x_2, y_2, z_2) is

d(P1,P2)=(x2−x1)2+(y2−y1)2+(z2−z1)2.\begin{aligned} &d(P_1, P_2) \\[0.4em] &\quad = \sqrt{\begin{aligned} &(x_2 - x_1)^2 + (y_2 - y_1)^2 \\ &\quad + (z_2 - z_1)^2 \end{aligned}}. \end{aligned}

Here is why. Let Q=(x2,y2,z1)Q = (x_2, y_2, z_1), the point at the height of P1P_1 directly below or above P2P_2. The segment P1QP_1Q lies in the plane z=z1z = z_1, so the distance formula of the plane gives

d(P1,Q)2=(x2−x1)2+(y2−y1)2.\begin{aligned} &d(P_1, Q)^2 \\[0.4em] &\quad = (x_2 - x_1)^2 + (y_2 - y_1)^2. \end{aligned}

The segment QP2QP_2 is vertical with length d(Q,P2)=∣z2−z1∣d(Q, P_2) = \lvert z_2 - z_1 \rvert, so it is perpendicular to P1QP_1Q. The Pythagorean theorem in the right triangle P1QP2P_1QP_2 gives

d(P1,P2)2=d(P1,Q)2+d(Q,P2)2,\begin{aligned} &d(P_1, P_2)^2 \\[0.4em] &\quad = d(P_1, Q)^2 + d(Q, P_2)^2, \end{aligned}

which is the formula. When QQ coincides with P1P_1 or with P2P_2 the formula still holds.

In plain words Use the plane distance formula along the floor, then the Pythagorean theorem once more to go up. The result is also the length of the vector ⟨x2−x1,y2−y1,z2−z1⟩\langle x_2 - x_1, y_2 - y_1, z_2 - z_1 \rangle from P1P_1 to P2P_2.

Example Find the distance from P1=(1,−2,3)P_1 = (1, -2, 3) to P2=(7,1,5)P_2 = (7, 1, 5). The floor step goes to Q=(7,1,3)Q = (7, 1, 3) with d(P1,Q)2=36+9=45d(P_1, Q)^2 = 36 + 9 = 45, and the vertical step has length 22. So

d(P1,P2)=62+32+22=45+4=7.\begin{aligned} d(P_1, P_2) &= \sqrt{6^2 + 3^2 + 2^2} \\[0.4em] &= \sqrt{45 + 4} \\[0.4em] &= 7. \end{aligned}

Midpoint formula in three dimensions

Definition The midpoint of the segment from P1=(x1,y1,z1)P_1 = (x_1, y_1, z_1) to P2=(x2,y2,z2)P_2 = (x_2, y_2, z_2) is

M=(x1+x22,y1+y22,z1+z22).\begin{gathered} M = \\[0.4em] \left( \frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2}, \frac{z_1 + z_2}{2} \right). \end{gathered}

It lies on the segment and is at the same distance from P1P_1 and P2P_2, namely half of d(P1,P2)d(P_1, P_2).

In plain words Average the coordinates one at a time, exactly as in the plane.

Example The midpoint of (2,−1,4)(2, -1, 4) and (6,3,−2)(6, 3, -2) is (4,1,1)(4, 1, 1). As a check, the vectors from (4,1,1)(4, 1, 1) to the two endpoints are ⟨−2,−2,3⟩\langle -2, -2, 3 \rangle and ⟨2,2,−3⟩\langle 2, 2, -3 \rangle, so both distances equal 4+4+9=17\sqrt{4 + 4 + 9} = \sqrt{17}.

Spheres

Definition The sphere with center C=(h,k,l)C = (h, k, l) and radius r>0r > 0 is the set of all points in space whose distance from CC is rr. By the distance formula, a point (x,y,z)(x, y, z) lies on it exactly when

(x−h)2+(y−k)2+(z−l)2=r2.\begin{aligned} &(x - h)^2 + (y - k)^2 \\[0.4em] &\quad + (z - l)^2 = r^2. \end{aligned}

This is the standard equation of the sphere. The sphere is only the surface. The points at distance less than rr from CC lie inside it, and the sphere together with its inside is the solid ball, the set where the left side of this equation is at most r2r^2.

In plain words A sphere is the three-dimensional version of a circle, every point at the same distance from a center. Its equation is the circle equation with a zz term added.

Example The sphere with center (1,−2,3)(1, -2, 3) through the point (3,−1,5)(3, -1, 5) has r2=22+12+22=9r^2 = 2^2 + 1^2 + 2^2 = 9, so r=3r = 3 and the equation is

(x−1)2+(y+2)2+(z−3)2=9.(x - 1)^2 + (y + 2)^2 + (z - 3)^2 = 9.

Setting z=0z = 0 to see where it meets the floor gives (x−1)2+(y+2)2=0(x - 1)^2 + (y + 2)^2 = 0, which only (1,−2,0)(1, -2, 0) satisfies. The sphere just touches the xyxy-plane at that point, which makes sense because the center is 33 units above the floor and the radius is 33.

Finding the center and radius of a sphere

Definition An equation of the form

x2+y2+z2+Dx+Ey+Fz+G=0\begin{aligned} &x^2 + y^2 + z^2 \\[0.4em] &\quad + Dx + Ey + Fz + G = 0 \end{aligned}

can be rewritten by completing the square in each variable as

(x+D2)2+(y+E2)2+(z+F2)2=D2+E2+F24−G.\begin{aligned} &\left(x + \frac{D}{2}\right)^2 + \left(y + \frac{E}{2}\right)^2 \\[0.8em] &\quad + \left(z + \frac{F}{2}\right)^2 \\[0.8em] &\quad = \frac{D^2 + E^2 + F^2}{4} - G. \end{aligned}

If the right side is positive, the equation describes the sphere with center (−D2,−E2,−F2)(-\frac{D}{2}, -\frac{E}{2}, -\frac{F}{2}) whose radius is the square root of the right side. If the right side is zero, it describes that single point, and if it is negative, no point at all.

In plain words Group the xx terms, the yy terms and the zz terms, complete the square in each group, and move the constants to the right. Then read off the center and the radius.

Example Start from

x2+y2+z2−4x+6y−2z−2=0.\begin{aligned} &x^2 + y^2 + z^2 \\[0.4em] &\quad - 4x + 6y - 2z - 2 = 0. \end{aligned}

Completing the squares gives

(x−2)2−4+(y+3)2−9+(z−1)2−1−2=0,\begin{aligned} &(x - 2)^2 - 4 + (y + 3)^2 - 9 \\[0.4em] &\quad + (z - 1)^2 - 1 - 2 = 0, \end{aligned}

so

(x−2)2+(y+3)2+(z−1)2=16.\begin{aligned} &(x - 2)^2 + (y + 3)^2 \\[0.4em] &\quad + (z - 1)^2 = 16. \end{aligned}

This is the sphere with center (2,−3,1)(2, -3, 1) and radius 44.

Check yourself

  1. Find the distance between (−1,2,0)(-1, 2, 0) and (3,−2,7)(3, -2, 7).
Show the answer

The differences are 44, −4-4 and 77, so the distance is

42+(−4)2+72=16+16+49=81=9.\begin{aligned} &\sqrt{4^2 + (-4)^2 + 7^2} \\[0.4em] &\quad = \sqrt{16 + 16 + 49} \\[0.4em] &\quad = \sqrt{81} = 9. \end{aligned}
  1. In which octant is (2,−5,−3)(2, -5, -3)? Find its projection onto the xyxy-plane and its distance to the xzxz-plane.
Show the answer

It is in the octant where x>0x > 0, y<0y < 0 and z<0z < 0, below the floor. Its projection onto the xyxy-plane is (2,−5,0)(2, -5, 0), and its distance to the xzxz-plane is ∣−5∣=5\lvert -5 \rvert = 5.

  1. Find the center and radius of the sphere x2+y2+z2+8x−2z−8=0x^2 + y^2 + z^2 + 8x - 2z - 8 = 0.
Show the answer

Completing the squares gives

(x+4)2+y2+(z−1)2=8+16+1=25,\begin{aligned} &(x + 4)^2 + y^2 + (z - 1)^2 \\[0.4em] &\quad = 8 + 16 + 1 = 25, \end{aligned}

so the center is (−4,0,1)(-4, 0, 1) and the radius is 55.

How this lesson connects