[Math] Rotate a vector towards a point

3dvectors

I'm trying to figure out how to rotate a vector towards a certain point in a 3D plane, but I can't seem to find a solution. Here's the problem.

From a given position $P(x_P,y_P,z_P)$, vector $\vec{f}$ originates, with $\vec{f}=\begin{pmatrix} x_f\\y_f\\z_f \end{pmatrix}$. Somewhere else in the plane is point $M(x_M,y_M,z_M)$. Now I'm trying to figure out how to, given an angle $\theta$, one could find a vector $\vec{f'}$ that's basically $\vec{f}$ rotated $\theta$ towards $M$.

Best Answer

The Axis of Rotation is the cross-product of the before and after vectors.

The Angle of Rotation is the $ cos^{-1}$ of the dot-product of normalized before and after vectors.

You may also try looking at the StackExchange Computer Graphics