QAlign:

Path: AerospaceUtils/Coord

% Rotate about a body axis to align a body vector with an inertial vector.

 1. Begin with an initial quaternion

 2. Rotate about a body-frame axis to align a body-frame vector with an 
   inertial target vector

 3. Return the new quaternion

 Will generate a plot if no outputs are requested.
--------------------------------------------------------------------------
   Form:
   [q,rotAngle,sepAngle] = QAlign( q0, uBAxis, uBVec, uITarget );
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   q0          (4,:) Beginning inertial to body quaternion
   uBAxis      (3,1) Body-frame axis to rotate about
   uBVec       (3,1) Body-frame vector to align
   uITarget    (3,:) Inertial-frame vector to point at

   -------
   Outputs
   -------
   q           (4,:) Resulting Inertial-to-Body quaternion after rotation
   rotAngle    (1,:) Angle of rotation [rad]
   sepAngle    (1,:) Separation angle between body vector and target [rad]

--------------------------------------------------------------------------

Children:

AerospaceUtils: Coord/QRotateToAlign
Common: CommonData/SwooshWatermark
Common: General/CellToMat
Common: General/MatToCell
Common: General/Watermark
Common: Graphics/Coordinates
Common: Graphics/NewFig
Common: Graphics/Plot2D
Common: Graphics/PltStyle
Common: Quaternion/QForm
Common: Quaternion/QMult
Common: Quaternion/QPose
Common: Quaternion/QTForm
Math: Linear/Cross
Math: Linear/Unit

Back to the AerospaceUtils Module page