# 3D vector projection

#### 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

#### dwsmith

MHF Hall of Honor
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}||}\mathbf{L}$$

#### shenanigans87

Pretty sure this is 2nd or 3rd year calculus, not pre algebra.

#### 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.

#### dwsmith

MHF Hall of Honor
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$$

#### dwsmith

MHF Hall of Honor
$$\displaystyle < , >$$ inner product

$$\displaystyle ||\ ||$$ norm

• feastures

#### 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.

#### feastures

$$\displaystyle C=proj_L B=\frac{<\mathbf{B},\mathbf{L}>}{||\mathbf{L}||}\mathbf{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?

Last edited:

#### dwsmith

MHF Hall of Honor
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.