Distance of a point from a line and the foot of the… | StemPy Lab
Course 15.2·Lesson 3 of 3
Distance of a point from a line and the foot of the perpendicular
The distance of a point P from a line through A with direction b
Lesson 3 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
find the foot of the perpendicular from a point to a line;
find the distance of a point from a line in two ways;
find the points of a line at a given distance from a point.
A drone and a power line
A drone hovers at a point P near a straight power line. The nearest point of the line is straight below, in the sense that the segment from the drone to it meets the line at a right angle. That point is the foot of the perpendicular, F. The distance PF is the distance of the point from the line.
A three-dimensional picture of a blue line and a point P off the line. A red segment runs from P to the line and meets it at a right angle at the point F, the foot of the perpendicular. A small square marks the right angle. A dashed grey segment from P to another point Q of the line is longer than PF.
Method 1: the foot first
Let the line be r=a+tb. Any point of the line is F=a+tb. We want PF to be at right angles to the line, so
(F−P)⋅b=0⟹(a+tb−P)⋅b=0⟹t=∣b∣2(P−a)⋅b.
Put this t back to get F. Then PF is the distance. The method works in every book and also gives the foot, which the formula in Method 2 does not.
Method 2: the cross product
The vector P−a makes an angle θ with b. The perpendicular distance is ∣P−a∣sinθ. Since ∣u×b∣=∣u∣∣b∣sinθ, this gives
d=∣b∣∣(P−a)×b∣.
For the coordinate axes the answer is quick. The distance of (x,y,z) from the x-axis is y2+z2, from the y-axis it is x2+z2, and from the z-axis it is x2+y2.
A worked example
Find the foot of the perpendicular from P(5,1,4) to the line 2x−1=1y−2=2z−3, and the distance.
The vectors.a=(1,2,3) and b=(2,1,2). Then P−a=(4,−1,1).
The parameter.(4,−1,1)⋅(2,1,2)=8−1+2=9 and ∣b∣2=9. So t=1.
The foot.F=(1+2,2+1,3+2)=(3,3,5).
The distance.PF=∣(2,−2,−1)∣=4+4+1=3 units.
The check by Method 2.(4,−1,1)×(2,1,2)=(−3,−6,6) with length 9. Then d=39=3. Both methods agree.
A second example. The distance of the point (7,5,12) from the x-axis is 25+144=13 units.
Practise with new numbers
Try it in Python
The program finds the foot and the distance of the worked example by Method 1. It then checks the answer by Method 2.
Common mistakes
Dividing by ∣b∣ in t. The parameter divides by ∣b∣2, because b appears twice in tb.
Using the distance to a. The distance from P to the point A of the line is longer than the distance to the line itself.
Forgetting that the foot is on the line. Check that F=a+tb really satisfies the equation of the line.
Mixing P−a and a−P. The sign of t changes. Keep one order.
Remember these
The foot F=a+tb with t=∣b∣2(P−a)⋅b.
The distance is ∣PF∣, or ∣b∣∣(P−a)×b∣.
The distance from the x-axis is y2+z2.
PF⊥b is the equation that fixes the foot.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Find the distance of (7,5,12) from the y-axis.
Find the foot of the perpendicular from (4,5,2) to the line through the origin with direction ratios (1,2,2).
Find the distance of (4,5,2) from the same line.
Why is PF the shortest distance from P to the line?
If the distance of P from a line is 5, how far is P from a point of the line that is 12 units from the foot?
References
OpenStax, Calculus Volume 3, Chapter 2, sections on the dot product, the cross product and equations of lines in space (distance from a point to a line).
NCERT, Mathematics Part II for Class XII, Chapter 11, section on the equation of a line in space.
Enroll free in Skew Lines and Shortest Distances
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.