# vector projections

This topic is 4658 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm reviewing my linear algebra and have come across something that I don't fully understand. I know that we can find the projection of a vector P onto a vector Q by the following: proj_q P = (P.Q)/||Q|| (eq 1.0) This tells us the length of P projected onto Q. What I'm not fully grasping is why we then multiply this by Q normalized, or Q/||Q|| giving: proj_q P = ((P.Q)/||Q||^2) * Q (eq 1.1) The book I have says this gives us the vector of the desired length (eq 1.0) that is parallel to the vector Q. I'm just not sure why multiplying the projected vector by the normalized vector Q will give us a parallel vector. I'm guessing there's some geometric proof for this, but I can't seem to find it. Any help is greatly appreciated, thanks :)

##### Share on other sites
Consider - the projection of P on Q is the component of P in the same direction as Q. Therefore, the projection of P on Q is parallel to Q and is therefore a*Q for some value A. If we make Q normalized, then a = the length of the projection.

In other words - Q/||Q|| is a vector with length 1 in the same direction as Q. We desire a vector of length (P dot Q)/||Q|| in the same direction as Q. So therefore, (P dot Q)/||Q||^2 * Q fits the bill.

##### Share on other sites
beautiful, I wasn't really taking into account the fact that a normalized vector inherently contains the directional data of the vector. Thanks a lot for clearing that up for me, it makes a lot more sense now! :)

##### Share on other sites
The general form for a projection into a subspace is P = A(ATA)-1ATb, where A is your subspace basis and b is your point in Rm. As you can see, for vector projections (A is 3x1), it simplifies to A(A.b/A.A). What's probably the most interesting thing about this form of the projection is that you can use it to solve the least-squares minimization problem. This is because the projected point is the closest point on the subspace to the original point.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

(You must login to your GameDev.net account.)

• 13
• 9
• 15
• 14
• 46
• ### Forum Statistics

• Total Topics
634059
• Total Posts
3015291
×