# How do you find a point Q on the line L such that PQ is perpendicular to L

P is the point (1,1,1) and the line L is given by the equation

x ¯ = t ( 1 0 - 1 )

• Assume that $Q$ lies on the line, with parameter value $t_0$. Then you know the two lines. What is the angle between them? You can calculate their dot product. Jan 22, 2019 at 11:39

Point Q is a projection of point P onto line L. You can find it calculating dot product of vector L and P:

L = (1 0 -1)

Lnorm = L / length(L)

P = (1 1 1)

Q = Lnorm * dot(P, Lnorm)

P.S. But this is not universal. I simplified formula because you line L starts at point (0 0 0). In general case formula will be Q = A + Lnorm * dot(P - A, Lnorm), where A is some point on line L.

• I'm confused about why you need Lnorm and can't just use L, and why you multiply Lnorm with the dot product of Lnorm and P. Jan 22, 2019 at 23:28

For $$a,b,c,d,e,f\in \Bbb R$$ and $$t\in \Bbb R,$$ let $$v(t)=(at+b,ct+d,et+f).$$ If $$L=\{v(t):t\in \Bbb R\}$$ and $$P=(x,y,z)$$ then the square of the distance from $$P$$ to any $$v(t)\in L$$ is $$G(t)=(at+b-x)^2+(ct+d-y)^2+(et+f-z)^2,$$ which is a quadratic function of $$t$$. When $$G(t_0)=\min \{G(t):t\in \Bbb R\}$$ we have $$v(t_0)=Q.$$