How far is it, really?
A drone hovering over a sloped solar-panel roof: how far is it from the roof? A lamp hanging over a table: how far is it from the table's edge? "Distance" always means the shortest distance, and the shortest path from a point to a line or a plane is always the perpendicular one. In this lesson you will compute these distances with projections and cross products.
Remember from Grade 10: in Analytic Geometry you found the distance from a point to a line in two-space. Remember from Dot and Cross Products: the scalar projection of a onto b is (a · b)/|b|, and |a × b| is the area of the parallelogram formed by a and b.
Distance from a point to a plane
Let the plane be Ax + By + Cz + D = 0 with normal n = [A, B, C], and let P(x₀, y₀, z₀) be the point. Choose any point Q(x₁, y₁, z₁) on the plane. The distance is the length of the projection of QP onto n:
d = |QP · n| / |n| = |A(x₀ − x₁) + B(y₀ − y₁) + C(z₀ − z₁)| / |n|.
Because Q is on the plane, Ax₁ + By₁ + Cz₁ = −D. So
d = |Ax₀ + By₀ + Cz₀ + D| / √(A² + B² + C²).
The same idea in two-space gives d = |Ax₀ + By₀ + C| / √(A² + B²), a shortcut for the Grade 10 method (perpendicular line, point of intersection, then the length formula).
Distance between parallel planes: pick any point on one plane and find its distance to the other. If both are written with the same normal, Ax + By + Cz + D₁ = 0 and Ax + By + Cz + D₂ = 0, then d = |D₁ − D₂| / √(A² + B² + C²).
Distance from a point to a line in three-space
For the line r = r₀ + tm through Q₀, and a point P:
d = |Q₀P × m| / |m|.
(See the parallelogram picture: area ÷ base = height.)
The foot of the perpendicular. The closest point F on the line has the form r₀ + tm, with FP perpendicular to m. Solve (r₀ + tm − p) · m = 0 for t. Then d = |FP|. This gives both the distance and the closest point.
Distance between parallel lines: take a point on one line and find its distance to the other.
Worked exampleExample 2: A plane given in vector form
Find the distance from A(−5, 3, 7) to the plane r = [0, 0, 2] + s[−1, 1, 3] + t[2, 0, −3].
- From the lesson Intersection of a Line and a Plane, this plane is 3x − 3y + 2z − 4 = 0.
- Numerator: |3(−5) − 3(3) + 2(7) − 4| = |−15 − 9 + 14 − 4| = 14.
- Denominator: √(9 + 9 + 4) = √22.
d = 14/√22 = 7√22/11 ≈ 2.98, the same value we found there from the foot of the perpendicular.
Worked exampleExample 3: Point to line, with the closest point
Find the distance from P(1, 2, 3) to the line r = [2, 0, 1] + t[1, 1, 0], and the closest point on the line.
- Q₀ = (2, 0, 1), so Q₀P = [−1, 2, 2]. m = [1, 1, 0].
- Q₀P × m = [(2)(0) − (2)(1), (2)(1) − (−1)(0), (−1)(1) − (2)(1)] = [−2, 2, −3], with magnitude √17.
- d = √17 / √2 = √8.5 ≈ 2.92.
- Closest point: F(t) − P = [1 + t, −2 + t, −2]. Set it · m = 0: (1 + t) + (−2 + t) = 0, so t = 1/2 and F = (2.5, 0.5, 1).
- Check: FP = [−1.5, 1.5, 2], |FP| = √(2.25 + 2.25 + 4) = √8.5 ✓.
d = √8.5 ≈ 2.92, at the closest point (2.5, 0.5, 1).
Hands-on activityFind the shortest path
You need: a tape measure, a table, a broom (or a long stick) and a coin.
- Point to plane. Hold the end of the tape measure at a corner of the tabletop. Stretch it to several different spots on the floor and record the readings. Which reading is smallest, and where is that spot?
- Compare the smallest reading with the table's height measured straight down.
- Point to line. Lay the broom on the floor. Put a coin on the floor about 40 cm from the handle. Measure from the coin to five points along the handle. Find the smallest reading. Check with a book corner (a right angle) that the shortest segment meets the handle at 90°.
What to look for: the shortest reading is always the perpendicular one: straight down to the floor in step 1, and at a right angle to the handle in step 3. Every other reading is longer, as the Pythagorean theorem predicts.