\input manualMacros.tex
\manBegin
\manPageInfo{RCCL Reference Manual}{}{}
\manTitle{multQtrn}{3}
\manSection{NAME}
{\rightskip=0ptplus1fil
{\tt \manName{multQtrn}},
{\tt \manName{multLiQtrn}},
{\tt \manName{multRiQtrn}},
{\tt \manName{invertQtrn}},
{\tt \manName{unitQtrn}},
{\tt \manName{normQtrn}}
-- RCCL routines to manipulate quaternions.
}
\manSection{USAGE}
\cverbatim
#include <robotTypes.h> /* included as part of <rccl.h> */

multQtrn (qr, q1, q2)
  QTRN *qr, *q1, *q2;

multLiQtrn (qr, q1, q2)
  QTRN *qr, *q1, *q2;

multRiQtrn (qr, q1, q2)
  QTRN *qr, *q1, *q2;

invertQtrn (qr, q1)
  QTRN *qr, *q1;

unitQtrn (qr, q1);
  QTRN *qr, *q1;

float normQtrn (q1)
  QTRN *q1;
@endcverbatim
\manSection{ARGUMENTS}
\manItem{{\tt qr} --}
Result quaternion.
\manItem{{\tt q1}, {\tt q2} --}
Input quaternions.
\manSection{DESCRIPTION}
These routines perform operations on the quaternion
data type {\tt QTRN}.

{\tt multQtrn()} computes the quaternion product 
\manIfTeX
$$
        {\bf q}\sb r \;=\; {\bf q}\sb 1 \; {\bf q}\sb 2.
$$
\manElse
\cverbatim
                qr = q1 q2 .
@endcverbatim
\manFi

{\tt multLiQtrn()} computes the quaternion product 
\manIfTeX
$$
        {\bf q}\sb r \;=\; {\bf q}\sb 1^{-1} {\bf q}\sb 2.
$$
\manElse
\cverbatim
                       -1
                qr = q1   q2 .
@endcverbatim
\manFi

{\tt multRiQtrn()} computes the quaternion product 
\manIfTeX
$$
        {\bf q}\sb r \;=\; {\bf q}\sb 1 \; {\bf q}\sb 2^{-1}.
$$
\manElse
\cverbatim
                          -1
                qr = q1 q2 .
@endcverbatim
\manFi

{\tt invertQtrn()} computes the inverse of a quaternion:
\manIfTeX
$$
        {\bf q}\sb r \;=\; {\bf q}\sb 1^{-1}.
$$
\manElse
\cverbatim
                       -1
                qr = q1 .
@endcverbatim
\manFi

{\tt unitQtrn()} normalizes a quaternion:
\manIfTeX
$$
        {\bf q}\sb r \;=\; {\bf q}\sb 1 / |{\bf q}\sb 1|.
$$
\manElse
\cverbatim
                qr = q1 / |q1| .
@endcverbatim
\manFi

Each of the above routines returns a pointer to its result argument.

{\tt normQtrn()} returns the magnitude of a quaternion. This is not
likely to be used much, since RCCL generally assumes the quaternions it uses
are unit quaternions.
\manSection{SEE ALSO}
{\tt quaternion(3)}.
\raggedright
\manEnd
\end
