Am looking for a way to transpose a 2D solution of a problem to a 3D solution of the same problem.
The algorithm I've implemented in 2D works as follows:
Given the points $A (A_x, A_y)$ and $B (B_x, B_y)$.
- Compute the absolute angle of point $A$ via $\text{atan2}(A_x, A_y) \rightarrow A_\alpha$
- Compute the absolute angle of point $B$ via $\text{atan2}(B_x, B_y)\rightarrow B_{\alpha}$
- Compute the resulting point $C$ by point-distance of point $B$ and applying the angle $A_{\alpha}+B_\alpha$.
The effect is that $C$ is point $B$ further rotated around the origin $(0,0)$ by as much as point $A$ is rotated around origin $(0,0)$.
This image visualizes that: 2D Angles
What I need now is the same in the third dimension. The points are threedimensional coordinates and obviously instead of angles I'll need quaternions. Am already knowing how to apply quaternions to 3D points but I cannot get an idea how to compute the transformation quaternion that is the equivalent to $A_\alpha$.
Could someone push me in the right direction perhaps?
Huge thanks in advance!