[Math] Linear Algebra: Find the distance from the point $Q(2,2)$ to the line $ L$ whith parametrization $[x,y] = [-1,2] + t[1,-1]$

linear algebra

The question is asking to find the distance from the point $Q(2,2)$ to the line $L$ whith parametrization $[x,y] = [-1,2] + t[1,-1] $.

So first I find a point $A$ that lies on the line. From the equation of the line given, I know that $[-1,2]$ is a point that lies on the line. I know this because the vector form equation of a line is $x = p + td $ where $p$ is a point on the line.

Then I find the vector $QA$ , by taking the difference of the coordinates of $A$ and $Q$v. From this I get $[-3,0]$ .

Then I find the projection of $QA$ onto $d$ ($d$ is the directional vector for line $L$). I know $d$ is $[1,-1]$ from the equation of the line provided, so finding the projection of $[-3,0]$ onto $[1,-1]$ gave me $[-3,3]$ .

Lastly, the distance between the point $ Q $and a point on the line $L$, which I'll call $P$ , is found like so:
$QP = QA$– (projection of $ QA$ onto $ d$)

And the result I get is $ [0,-3]$ . But my textbook says that's not correct.

Could someone maybe do the question or tell me where I went wrong? Also, apologies for not formatting this properly, this is my first post and I'm not sure how to.
Any help whatsoever is appreciated.

Best Answer

As an alternative we can consider the segment

$$QA=(-3+t,-t)$$

and use the condition of perpendicularity with the direction vector of the line that is

$$QA\cdot v=0 \implies -3+t+t=0 \implies t=\frac32$$

therefore

$$QA=(-3/2,-3/2) \implies |QA|=\frac32\sqrt 2$$

By your method note that te projection of $a=(-3,0)$ onto $b=(1,-1)$ is given by

$$a_\perp=\frac{a\cdot b}{b\cdot b}b=(-3/2,3/2)$$

and then

$$a_\parallel=a-a_\perp=(3/2,3/2)$$