# Homework Help: Vector projection onto a straight line

1. Nov 19, 2009

### Combinatus

1. The problem statement, all variables and given/known data

Determine the matrix for the spatial projection perpendicular to the straight line (x1, x2, x3) = t(1, 2, 3). The vector space is orthonormal.

2. Relevant equations

3. The attempt at a solution

After a trip to #math on freenode that resulted in discussions of Gram-Schmidt processes and bra-ket-like vector notations used in physics, I don't even know where to begin any longer. I suspect that this is supposedly a very rudimentary problem of geometric intuition, since I hadn't heard of projections until yesterday.

Anyway, if u=(a1,a2,a3) is an arbitrary vector and P is the projection (which is assumed to be linear), then P(u) = a1*P(e1) + a2*P(e2) + a3*P(e3), since e1, e2 and e3 are base vectors. Now, P(e1), P(e2) and P(e3) should be column vectors in the sought matrix.

Unfortunately, I don't know how to determine their coordinates.

In one attempt to determine them, I assigned s = (1,2,3) as a vector parallel to the line t(1,2,3). So, the dot product e1*s = |e1||s|cos(A) = 1*1 + 2*0 + 3*0 = 1, if e1=(1,0,0) and A is the angle between e1 and s. Then, A = arccos(1/sqrt(14)), since |s|=sqrt(14).

However, I'm getting nowhere with this approach. I can't really determine a normal of the line t(1,2,3) either. Bleh. Ideas are welcome.

Edit: Perhaps I can use the shortest distance between the tip of the vector u and the line...

Last edited: Nov 19, 2009
2. Nov 19, 2009

### Combinatus

I think I solved it. Not sure if my approach was optimal, but oh well.

Basically, the sought projected vector should be parallel to s = (1,2,3), e.g. be written on the form L(1, 2, 3), where L is an unknown constant. Then, the vector perpendicular to the line between the tip of u and the line is then b = (L-a1, 2L-a2, 3L-a3). Using the dot product, we get b*s = L-a1 + 4L-2a2 + 9L-3a3 = 0 <=> L = (1/14)*(a1 + 2a2 + 3a3).

Inserting these values of L gives the coordinates of the sought vector as (1/14)*(a1 + 2a2 + 3a3)*(1,2,3). This corresponds to the projection matrix

$$\frac{1}{14} \begin{bmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 3 & 6 & 9 \end{bmatrix}$$