next up previous contents
Next: The Rotation Group Up: HepRotation Class Previous: Nearness for HepRotations About   Contents

Comparison for HepRotations, HepAxisAngles, and HepEulerAngles

Of the three classes, HepAxisAngle has a natural meaning for ordering comparisons, taking advantage of the ordering relation already available for the UnitVector axes:

\begin{displaymath}
( \hat{u}_1 , \delta_1 ) > ( \hat{u}_2 , \delta_2 ) \mbox{ ...
...at{u}_1 = \hat{u}_2 \mbox { and }
\delta_1 > \delta_2 \right]
\end{displaymath} (158)

For Rotation, we use the ordering induced by its HepAxisAngle expression:

\begin{displaymath}
r_1 > r_2 \mbox{ iff } r_1 \mbox{.axisAngle()} > r_1 \mbox{.axisAngle()}
\end{displaymath} (159)

Extracting the HepAxisAngle corresponding to a HepRotation is a fairly simple task. However, for testing equality or inequality, the package uses the even easier method of element-by-element equality checking.

For HepEulerAngles, rather than laboriously going over to HepRotations and then using the induced HepAxisAngle comparison, we adapt simple dictionary ordering:

$\displaystyle ( \phi_1 , \theta_1, \psi_1 ) > ( \phi_2 , \theta_2, \psi_2 ) \mbox{ if }$      
$\displaystyle \phi_1 > \phi_2 \mbox { or }$      
$\displaystyle \left[
\phi_1 = \phi_2 \mbox { and } \theta_1 > \theta_2 \right]
\mbox { or }$      
$\displaystyle \left[
\phi_1 = \phi_2 \mbox { and } \theta_1 = \theta_2
\mbox { and } \psi_1 = \psi_2
\right]$     (160)


next up previous contents
Next: The Rotation Group Up: HepRotation Class Previous: Nearness for HepRotations About   Contents
Fermilab ZOOM Physics Class Library Task Force