\input manualMacros.tex
\manBegin
\manPageInfo{RCCL Reference Manual}{}{}
\manTitle{vaoToTrsf}{3}
\manSection{NAME}
{\rightskip=0ptplus1fil
{\tt \manName{vaoToTrsf}},
{\tt \manName{multTrsfVao}} 
-- RCCL routines to specify rotation using matrix components.
}
\manSection{USAGE}
\cverbatim
#include <robotTypes.h>    /* included as part of <rccl.h> */

TRSF *vaoToTrsf (tr, ax, ay, az, ox, oy, oz)
  TRSF *tr;
  float ax, ay, az, ox, oy, oz;
                
TRSF *multTrsfVao (tr, ax, ay, az, ox, oy, oz)
  TRSF *tr;
  float ax, ay, az, ox, oy, oz;
@endcverbatim
\manSection{ARGUMENTS}
\manItem{{\tt tr} --}
Result (and possibly input) transform.
\manItem{{\tt ax}, {\tt ay}, {\tt az} --}
Components of a vector parallel to the desired {\bf a} vector.
\manItem{{\tt ox}, {\tt oy}, {\tt oz} --}
Components of a vector parallel to the desired {\bf o} vector.
\manSection{DESCRIPTION}
{\tt vaoToTrsf()} sets the rotational component of the transform {\TT tr}
as specified by the two vectors {\bf a} and {\bf o}.

Ostensibly, {\bf a} and {\bf o} represent unit vectors in the desired
$z$ and $y$ directions (the vector {\bf n}, which is the
unit vector in the $x$ direction, can be computed from
${\bf o} \times {\bf a}$). Actually, the vectors need to be
neither normalized nor orthogonal:
the new columns of the rotation matrix (${\bf n}'$, ${\bf o}'$, and 
${\bf a}'$)
are derived
from {\bf a} and {\bf o} as follows:
\manIfTeX
$$
\eqalign{
{\bf a}' = \,& {{\bf a}\over |{\bf a}|}\cr
{\bf o}' = \,& {{\bf x}\over |{\bf x}|}, \;\; \hbox {where} \quad
{\bf x} = {\bf a}' \times ( {\bf o}\times {\bf a}' ) \cr
{\bf n}' = \,& {\bf o}' \times {\bf a}'\cr}
$$
\manElse
\cverbatim
                a' = a / |a|

                o' = x / |x|, where x = a' X (o X a')

                n' = o' X a'
@endcverbatim
\manFi

{\tt multTrsfVao()}
post-multiplies (in place) the transformation
{\TT tr} with the rotation specified by
{\bf a} and {\bf o}.

Each of these routines returns a pointer to its result argument.
\manSection{SEE ALSO}
\rightskip=0ptplus1fil
{\tt xyzToTrsf(3)}, {\tt multTrsf(3)}, {\tt rotToTrsf(3)}, {\tt rpyToTrsf(3)}, {\tt eulToTrsf(3)}.
\manEnd
\end
