Scaling vector by other vector to match its projection

297 Views Asked by At

I have 2 vectors a and b. They both are 3D.

I would like to scale vector b, so that its projection would be the same length as vector b.

I attached a sketch below. How much should I scale vector b so that its projection would be the same length as a

Vector Projection

2

There are 2 best solutions below

1
On

Hint: $$\cos(\alpha)=\frac{\vec a\cdot \vec b}{|\vec a||\vec b|}$$

Suppose you scale $\vec b$ such that the new vetcor is $k\vec b$, what is $\cos(\alpha)k|\vec b|$ by looking at the figure?

0
On

The length of the projection of $\vec b$ onto $\vec a$ is, as I’m sure you already know, equal to ${\vec a\cdot\vec b \over \|\vec a\|}$. You’re looking for a scalar $\lambda$ such that $${\vec a\cdot(\lambda\vec b) \over \|\vec a\|} = \lambda {\vec a\cdot\vec b \over \|\vec a\|} = \|\vec a\|.$$ Solve this equation for $\lambda$.