Finding a perpendicular component of a velocity vector relative to a point

1.3k Views Asked by At

I have a object which has a position vector(a,b) and velocity vector(l,m). I also have another point(x,y). I want to find the component of the velocity that is perpendicular to the other point.

enter image description here

I would appreciate any help. Also This is for game development and not some homework.

1

There are 1 best solutions below

2
On BEST ANSWER

In three dimensions you can use the cross product: $$ \left(\matrix{u_x\\u_y\\u_z}\right) \times \left(\matrix{v_x\\ v_y\\ v_z}\right) =\left(\matrix{ u_y v_z - u_z v_y \\ u_z v_x - u_x v_z\\ u_x v_y - u_y v_x}\right) $$ for which $||u\times v||= ||u|| ||v|| \sin\left(\angle(u,v)\right)$. (In two dimensions you can just use the last line by pretending to add a $0$ as z component to all vectors.)

With that, you can calculate your 'tangential velocity' as $$ v_t= \frac{ (a -x)\times v}{||a - x||} $$ where $||\cdot||$ is the Euclidean norm, $||a||=\sqrt{a_x^2 + a_y^2 + a_z^2}$, $a$ is your object with velocity $v$ and $x$ is the other point.