Multivariable Calculus · Undergraduate

Three-Dimensional Coordinates, Distance and Spheres

Quick answer

Three mutually perpendicular axes locate every point in space with an ordered triple (x, y, z). The distance between two points comes from applying the Pythagorean theorem twice, giving a formula with three squared differences. The points at a fixed distance from a center form a sphere, and completing the square in each variable finds the center and radius of one written out in expanded form. An equation in x, y and z usually describes a surface: z = 3 is a plane, and x² + y² = 4 is a cylinder.

What you'll learn

  • Plot and describe points and regions in three dimensions
  • Find the distance and midpoint between two points in space
  • Write the equation of a sphere and find its center and radius
  • Recognize planes and cylinders from their equations

A third axis

Add a zz-axis perpendicular to both the xx- and yy-axes, and every point in space gets an address (x,y,z)(x, y, z). The axes follow the right-hand rule. Curl the fingers of your right hand from the positive xx-axis toward the positive yy-axis, and your thumb points along the positive zz-axis.

The three coordinate planes, z=0z = 0, y=0y = 0 and x=0x = 0, divide space into eight octants; the first octant is where all three coordinates are positive. Equations that fix one coordinate describe flat sheets: z=3z = 3 is the horizontal plane at height 33, and x=−2x = -2 is a vertical plane parallel to the yzyz-plane.

Distance in space

To get 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), first move across the floor, which is a plane distance, then rise straight up by z2−z1z_2 - z_1. Those two legs meet at a right angle, so

d=(x2−x1)2+(y2−y1)2+(z2−z1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}

The midpoint averages each coordinate, the same way it does in the plane.

Why a sphere has this equation

A sphere is the set of points at a fixed distance rr from a center (h,k,l)(h, k, l). Writing that distance with the formula and squaring both sides gives

(x−h)2+(y−k)2+(z−l)2=r2(x - h)^2 + (y - k)^2 + (z - l)^2 = r^2

The equation of a sphere is the distance formula with the distance held fixed, exactly as the equation of a circle is in the plane. Cutting a sphere with a horizontal plane z=cz = c fixes the last term and leaves a circle, which is how three-dimensional shapes are studied through two-dimensional slices.

Slices of the sphere x² + y² + z² = 25 Two circles centered at the origin, seen from above. The outer circle of radius 5 is the slice through the middle of the sphere, at z = 0. The inner circle of radius 4 is the slice at height z = 3, where x² + y² = 25 − 9 = 16. -6-4-2246-6-4-2246xy z = 0 z = 3
Slices of the sphere x² + y² + z² = 25

Worked examples

Common mistakes

Practice problems

  1. Find the distance from the origin to (2,3,6)(2, 3, 6).

    Answer

    77

    Full solution

    4+9+36=49\sqrt{4 + 9 + 36} = \sqrt{49}.

  2. Find the distance between (1,−1,2)(1, -1, 2) and (3,1,3)(3, 1, 3).

    Answer

    33

    Full solution

    The differences are 22, 22 and 11, so d=4+4+1=3d = \sqrt{4 + 4 + 1} = 3.

  3. Write the equation of the sphere centered at the origin with radius 33. Is (2,1,2)(2, 1, 2) on it?

    Answer

    x2+y2+z2=9x^2 + y^2 + z^2 = 9; yes

    Full solution

    4+1+4=94 + 1 + 4 = 9, so the point is exactly 33 from the origin.

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

    Answer

    Center (−1,0,4)(-1, 0, 4), radius 33

    Full solution

    Completing the squares adds 11 and 1616: (x+1)2+y2+(z−4)2=−8+1+16=9(x + 1)^2 + y^2 + (z - 4)^2 = -8 + 1 + 16 = 9.

  5. Find the midpoint of (4,0,−2)(4, 0, -2) and (−2,6,8)(-2, 6, 8).

    Answer

    (1,3,3)(1, 3, 3)

    Full solution

    Average each coordinate.

  6. Describe the set of points with y=−1y = -1 in space.

    Answer

    A plane parallel to the xzxz-plane

    Full solution

    xx and zz are free, so the points fill a flat sheet one unit behind the xzxz-plane.

  7. Describe the surface y2+z2=9y^2 + z^2 = 9.

    Answer

    A cylinder of radius 33 around the xx-axis

    Full solution

    The variable xx is missing, so the circle y2+z2=9y^2 + z^2 = 9 repeats along the whole xx-axis.

  8. The sphere x2+y2+z2=25x^2 + y^2 + z^2 = 25 is cut by the plane z=4z = 4. Describe the cut.

    Answer

    A circle of radius 33 at height 44

    Full solution

    Substituting z=4z = 4 leaves x2+y2=9x^2 + y^2 = 9.

  9. Which point is closer to the xyxy-plane, (1,7,−2)(1, 7, -2) or (6,0,3)(6, 0, 3)?

    Answer

    (1,7,−2)(1, 7, -2)

    Full solution

    The distance to the xyxy-plane is ∣z∣|z|: 22 for the first point and 33 for the second.

  10. A student reads (x−1)2+(y+2)2+z2=9(x - 1)^2 + (y + 2)^2 + z^2 = 9 as the sphere with center (−1,2,0)(-1, 2, 0). What went wrong?

    Hint

    What value of xx makes (x−1)2(x - 1)^2 zero?

    Answer

    The signs flip: the center is (1,−2,0)(1, -2, 0).

    Full solution

    The form is (x−h)2+(y−k)2+(z−l)2(x - h)^2 + (y - k)^2 + (z - l)^2, so (x−1)(x - 1) means h=1h = 1 and (y+2)=(y−(−2))(y + 2) = (y - (-2)) means k=−2k = -2. The radius is 33.

Frequently asked questions

What is the distance formula in three dimensions?

The distance between (x₁, y₁, z₁) and (x₂, y₂, z₂) is √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²).

What is the equation of a sphere?

(x − h)² + (y − k)² + (z − l)² = r², for center (h, k, l) and radius r.

What does z = 3 describe in space?

The horizontal plane of all points at height 3. In the plane an equation like y = 3 is a line; in space it is a plane.

What does x² + y² = 4 describe in space?

A cylinder of radius 2 around the z-axis. The equation places no condition on z, so the circle in the xy-plane is repeated at every height.

What is the right-hand rule for axes?

Curl the fingers of your right hand from the positive x-axis toward the positive y-axis; your thumb points along the positive z-axis.

What to learn next