Logo
Published on

Using Vector Projections for Shortest Distances

Authors
  • avatar
    Name
    Vu Hung
    Twitter

Problem Statement

A line LL passes through the points A(−1,2)A(-1, 2) and B(3,5)B(3, 5). A point P(4,1)P(4, 1) does not lie on the line.

  1. Find the vector AB⃗\vec{AB} and the vector AP⃗\vec{AP}.
  2. Using vector projection, find the shortest distance from the point PP to the line LL.

Hints

  • Recall that the shortest distance from a point to a line is the perpendicular distance.
  • The scalar projection of AP⃗\vec{AP} onto AB⃗\vec{AB} gives the length of the adjacent side of the right-angled triangle formed by AA, PP, and the point on the line closest to PP.
  • You can use Pythagoras' theorem with the length of AP⃗\vec{AP} and the scalar projection of AP⃗\vec{AP} onto AB⃗\vec{AB} to find the perpendicular distance.
  • Alternatively, the vector projection projAB⃗AP⃗\text{proj}_{\vec{AB}} \vec{AP} can be used. The perpendicular vector is AP⃗−projAB⃗AP⃗\vec{AP} - \text{proj}_{\vec{AB}} \vec{AP}, and its magnitude is the shortest distance.

Solutions

  1. First, we find the vectors AB⃗\vec{AB} and AP⃗\vec{AP}: AB⃗=(3−(−1)5−2)=(43)\vec{AB} = \begin{pmatrix} 3 - (-1) \\ 5 - 2 \end{pmatrix} = \begin{pmatrix} 4 \\ 3 \end{pmatrix} AP⃗=(4−(−1)1−2)=(5−1)\vec{AP} = \begin{pmatrix} 4 - (-1) \\ 1 - 2 \end{pmatrix} = \begin{pmatrix} 5 \\ -1 \end{pmatrix}

  2. Let NN be the point on the line LL that is closest to PP. The line segment PNPN is perpendicular to LL. The length ANAN is the scalar projection of AP⃗\vec{AP} onto AB⃗\vec{AB}. Let's calculate this scalar projection: Scalar Projection=AP⃗⋅AB⃗∣AB⃗∣\text{Scalar Projection} = \frac{\vec{AP} \cdot \vec{AB}}{|\vec{AB}|} First, find the dot product AP⃗⋅AB⃗\vec{AP} \cdot \vec{AB}: AP⃗⋅AB⃗=(5)(4)+(−1)(3)=20−3=17\vec{AP} \cdot \vec{AB} = (5)(4) + (-1)(3) = 20 - 3 = 17 Next, find the magnitude of AB⃗\vec{AB}: ∣AB⃗∣=42+32=16+9=25=5|\vec{AB}| = \sqrt{4^2 + 3^2} = \sqrt{16 + 9} = \sqrt{25} = 5 So, the scalar projection AN=175AN = \frac{17}{5}.

    Now, we find the magnitude of AP⃗\vec{AP} (the hypotenuse of the right-angled triangle △APN\triangle APN): ∣AP⃗∣=52+(−1)2=25+1=26|\vec{AP}| = \sqrt{5^2 + (-1)^2} = \sqrt{25 + 1} = \sqrt{26}

    Finally, we use Pythagoras' theorem in △APN\triangle APN to find PNPN, which is the shortest distance dd: ∣AP⃗∣2=AN2+PN2|\vec{AP}|^2 = AN^2 + PN^2 26=(175)2+d226 = \left(\frac{17}{5}\right)^2 + d^2 d2=26−28925=650−28925=36125d^2 = 26 - \frac{289}{25} = \frac{650 - 289}{25} = \frac{361}{25} Taking the positive square root: d=195=3.8d = \frac{19}{5} = 3.8

    The shortest distance from PP to the line LL is exactly 3.83.8 units.


Takeaways

  • Vectors provide a powerful, geometric way to solve shortest distance problems without needing to find the equation of a line or use calculus.
  • The scalar projection breaks a vector into orthogonal components, making it ideal for perpendicularity problems.
  • Always draw a quick diagram mentally or on paper to visualize how AP⃗\vec{AP}, its projection along the line, and the perpendicular distance form a right-angled triangle.

Further Readings


Connect with me

Mastered this vector technique? There's more where that came from!