[Math] find arc between two tips of vectors in 3D

geometrylinear algebra

The figure helps explaining the question:

enter image description here

I want to use TiKz to draw an arc between $A$ and $B$. Please note several things.

  1. This is a true 3D problem. There are already questions asked and solved for the 2D case. We assume that $\|B-O\|=\|A-O\|$.
  2. The common point between the two vectors $O$ does not have to be the origin, but it is not a big deal to translate the whole thing.
  3. I do not want 3D rotation matrices. I know the exact three coordinates of each of the three points $O$, $A$, and $B$. It is easy to compute the angle between the two vectors using dot product. So we have the range of angles. I want an equation wich is parametrized as a function of an angle between 0 and the angle between the two vectors.
  4. Any point in the plane of the two vectors can be written as:
    $P = O + s(B-O) + t(A-O)$. I would like simple expressions for $s$ and
    $t$ in terms of the components of the vectors.
  5. A point $X$ in the arc satisfies the equation $\|X-O\|=\|B-O\|$,
    $X=O + s(B-O)+t(A-O)$. 4 equations with 5 unknowns. I am missing an equation here. Actualy no. We need to eliminate 4 variables to come to the parametrization of the curve.
  6. Is there an easy way to solve this? (by easy I mean no 3D rotation matrices, no large system of equations.
  7. Still I would like a solution even if it is messy.
    Thanks.

Best Answer

The slerp formula is coordinate-free and gives you a constant-speed parametrization of the arc. In your case, assuming $O$ is at the origin, the formula is $$X = \frac{\sin\bigl((1-t)\phi\bigr)}{\sin\phi}A + \frac{\sin(t\phi)}{\sin\phi}B,$$ where $0\le t\le1$ and $\phi$ is the angle between $A$ and $B$. Observe that when $\phi=\pi/2$, the formula reduces to the usual $A\cos\theta+B\sin\theta$ parametrization of a circle, with $\theta=t\phi$.

Related Question