# 3D vector projection

• May 18th 2010, 12:09 PM
feastures
3D vector projection
Dear people,

I need to calculate the projection of a 3D vector, but I don't know how. Could you please help me?

There are two 3D vectors: A and B.

A and B are both on plane P.

L is a line on P, through the origin, and perpendicular to A.

How do I calculate the vector C which is the projection of B on L?

Cornelis
• May 18th 2010, 02:27 PM
dwsmith
Quote:

Originally Posted by feastures
Dear people,

I need to calculate the projection of a 3D vector, but I don't know how. Could you please help me?

There are two 3D vectors: A and B.

A and B are both on plane P.

L is a line on P, through the origin, and perpendicular to A.

How do I calculate the vector C which is the projection of B on L?

Cornelis

$\displaystyle C=proj_L B=\frac{<\mathbf{B},\mathbf{L}>}{||\mathbf{L}||}\m athbf{L}$
• May 18th 2010, 02:31 PM
shenanigans87
Pretty sure this is 2nd or 3rd year calculus, not pre algebra.
• May 18th 2010, 09:36 PM
feastures
Thank!

I'm not familiar with these notations so could you please explain how this works? Also, this definition can't be complete because A is not used.

I need to write software that implements this, so I'm looking for a means of calculating this.
• May 18th 2010, 09:40 PM
dwsmith
Quote:

Originally Posted by feastures
Thank!

I'm not familiar with these notations so could you please explain how this works? Also, this definition can't be complete because A is not used.

I need to write software that implements this, so I'm looking for a means of calculating this.

$\displaystyle L=A\times B$
• May 18th 2010, 09:41 PM
dwsmith
$\displaystyle < , >$ inner product

$\displaystyle ||\ ||$ norm
• May 18th 2010, 10:27 PM
feastures
Wow, thanks for the quick replies!

Looking at my post, I want to apologize: Because I was too focussed on my problem, I forgot to mention that only A and B are known and that I need to calculate C (using P and L as possible intermediates). So you initial reply was complete.

I will proceed to work this out.
• May 18th 2010, 10:59 PM
feastures
Quote:

Originally Posted by dwsmith
$\displaystyle C=proj_L B=\frac{<\mathbf{B},\mathbf{L}>}{||\mathbf{L}||}\m athbf{L}$

Wait a minute: L = AxB is perpendicular to both A and B. This is not what I want: A and B must be both on plane P. L must only be perpendicular to A, and L must be on P. So C will also be on P.

Am I missing something?
• May 19th 2010, 06:28 PM
dwsmith
Quote:

Originally Posted by feastures
Wait a minute: L = AxB is perpendicular to both A and B. This is not what I want: A and B must be both on plane P. L must only be perpendicular to A, and L must be on P. So C will also be on P.

Am I missing something?

If two vectors are in the same plane, then a vector parallel to one will be parallel to the other. By taking the cross product of A and B, you will obtain your normal vector.