# Eigenvector slew

In aerospace engineering, especially those areas dealing with spacecraft, the eigenvector slew is a method to calculate a steering correction (called a slew) by rotating the spacecraft around one fixed axis, or a gimbal. This corresponds in general to the fastest and most efficient way to reach the desired target orientation as there is only one acceleration phase and one braking phase for the angular rate. If this fixed axis is not a principal axis a time varying torque must be applied to force the spacecraft to rotate as desired, though. Also the gyroscopic effect of momentum wheels must be compensated for.
That such a rotation exists corresponds precisely to a main result of the mathematical theory of rotation operators, the (only real) eigenvector of the rotation operator corresponding to the desired re-orientation is this axis.
Given the current orientation of the craft, and the desired orientation of the craft in cartesian coordinates, the required axis of rotation and corresponding rotation angle to achieve the new orientation is determined by computing the eigenvector of the rotation operator.

## Problem

Let
    ${\hat {x}}\ ,\ {\hat {y}}\ ,\ {\hat {z}}$
be a body fixed reference system for a 3 axis stabilized spacecraft. The initial attitude is given by
    ${\hat {x}}={\hat {a}}$
    ${\hat {y}}={\hat {b}}$
    ${\hat {z}}={\hat {c}}.$
One wants to find an axis relative the spacecraft body
    ${\hat {r}}=r_{x}\cdot {\hat {x}}+r_{y}\cdot {\hat {y}}+r_{z}\cdot {\hat {z}}$
and a rotation angle $\alpha$ such that after the rotation with the angle $\alpha$ one has that
    ${\hat {x}}={\hat {d}}$
    ${\hat {y}}={\hat {e}}$
    ${\hat {z}}={\hat {f}}$
where
    ${\hat {d}}\ ,\ {\hat {e}}\ ,\ {\hat {f}}$
are the new target directions.
In vector form this means that
    ${\hat {d}}=r_{a}\cdot {\hat {r}}+\cos \alpha \cdot ({\hat {a}}-r_{a}\cdot {\hat {r}})+\sin \alpha \cdot {\hat {r}}\times {\hat {a}}$
    ${\hat {e}}=r_{b}\cdot {\hat {r}}+\cos \alpha \cdot ({\hat {b}}-r_{b}\cdot {\hat {r}})+\sin \alpha \cdot {\hat {r}}\times {\hat {b}}$
    ${\hat {f}}=r_{c}\cdot {\hat {r}}+\cos \alpha \cdot ({\hat {c}}-r_{c}\cdot {\hat {r}})+\sin \alpha \cdot {\hat {r}}\times {\hat {c}}.$

## Solution

In terms of linear algebra this means that one wants to find an eigenvector with the eigenvalue = 1 for the linear mapping defined by
    ${\hat {a}}\longrightarrow {\hat {d}}$
    ${\hat {b}}\longrightarrow {\hat {e}}$
    ${\hat {c}}\longrightarrow {\hat {f}}$
which relative to the
    ${\hat {a}}\ ,\ {\hat {b}}\ ,\ {\hat {c}}$
coordinate system has the matrix
    ${\begin{bmatrix}\langle {\hat {d}}|{\hat {a}}\rangle &\langle {\hat {e}}|{\hat {a}}\rangle &\langle {\hat {f}}|{\hat {a}}\rangle \\\langle {\hat {d}}|{\hat {b}}\rangle &\langle {\hat {e}}|{\hat {b}}\rangle &\langle {\hat {f}}|{\hat {b}}\rangle \\\langle {\hat {d}}|{\hat {c}}\rangle &\langle {\hat {e}}|{\hat {c}}\rangle &\langle {\hat {f}}|{\hat {c}}\rangle \end{bmatrix}}$
Because this is the matrix of the rotation operator relative the base vector system ${\hat {a}}\ ,\ {\hat {b}}\ ,\ {\hat {c}}$ the eigenvalue can be determined with the algorithm described in "Rotation operator (vector space)".
With the notations used here this is:
    $\cos \alpha ={\frac {\langle {\hat {d}}|{\hat {a}}\rangle +\langle {\hat {e}}|{\hat {b}}\rangle +\langle {\hat {f}}|{\hat {c}}\rangle -1}{2}}$
    $r_{a}=\langle {\hat {f}}|{\hat {b}}\rangle -\langle {\hat {e}}|{\hat {c}}\rangle$
    $r_{b}=\langle {\hat {d}}|{\hat {c}}\rangle -\langle {\hat {f}}|{\hat {a}}\rangle$
    $r_{c}=\langle {\hat {e}}|{\hat {a}}\rangle -\langle {\hat {d}}|{\hat {b}}\rangle$
    $|{\bar {r}}|={\sqrt {{r_{a}}^{2}+{r_{b}}^{2}+{r_{c}}^{2}}}$
    $\sin \alpha ={\frac {|{\bar {r}}|}{2}}$
The rotation angle $\alpha$ is
    $\alpha =\operatorname {arg} (\cos \alpha ,\sin \alpha )$
where "$\operatorname {arg} (x\ ,\ y)$" is the polar argument of the vector $(\ x\ ,\ y\ )$ corresponding to the function ATAN2(y,x) (or in double precision DATAN2(y,x)) available in for example the programming language FORTRAN.
The resulting $\alpha$ will be in the interval $0\leq \alpha \leq \pi$.
If $0<\alpha <\pi$ then $|{\bar {r}}|>0$ and the uniquely defined rotation (unit) vector is:
    ${\hat {r}}={\frac {\bar {r}}{|{\bar {r}}|}}$
Note that
    $\langle {\hat {d}}|{\hat {a}}\rangle +\langle {\hat {e}}|{\hat {b}}\rangle +\langle {\hat {f}}|{\hat {c}}\rangle$
is the trace of the matrix defined by the orthogonal linear mapping and that the components of the "eigenvector" are fixed and constant during the rotation, i.e.
    ${\hat {r}}=r_{x}\cdot {\hat {x}}(t)+r_{y}\cdot {\hat {y}}(t)+r_{z}\cdot {\hat {z}}(t)=r_{x}\cdot {\hat {a}}+r_{y}\cdot {\hat {b}}+r_{z}\cdot {\hat {c}}=r_{x}\cdot {\hat {d}}+r_{y}\cdot {\hat {e}}+r_{z}\cdot {\hat {f}}$
where ${\hat {x}}\ ,\ {\hat {y}}\ ,\ {\hat {z}}$ are moving with time $t$ during the slew.