Euler.h

Classes

Euler -- Vector of Euler rotation angles (full description)

class Euler

Interface

Public Members
friend ostream &operator<<(ostream &os, const Euler &eul)
Euler()
Euler(const Euler &other)
Euler &operator=(const Euler &other)
Euler(Double in0, Double in1 = 0, Double in2 = 0)
Euler(Double in0, uInt ax0, Double in1 = 0, uInt ax1=0, Double in2 = 0, uInt ax2=0)
Euler(const Quantity &in0)
Euler(const Quantity &in0, const Quantity &in1)
Euler(const Quantity &in0, const Quantity &in1, const Quantity &in2)
Euler(const Quantity &in0, uInt ax0)
Euler(const Quantity &in0, uInt ax0, const Quantity &in1, uInt ax1=0)
Euler(const Quantity &in0, uInt ax0, const Quantity &in1, uInt ax1, const Quantity &in2, uInt ax2=0)
Euler(const Quantum<Vector<Double> > &in)
Euler(const Quantum<Vector<Double> > &in, const Vector<uInt> &ax)
~Euler()
Euler operator-() const
Euler &operator+=(const Euler &right)
Euler operator+(const Euler &right) const
Euler &operator-=(const Euler &right)
Euler operator-(const Euler &right) const
Double &operator()(uInt which)
const Double &operator()(uInt which) const
Quantum<Vector<Double> > getAngle() const
Quantum<Vector<Double> > getAngle(const Unit &unit) const
void set(uInt which, uInt ax)
void set(uInt ax0, uInt ax1, uInt ax2)
Int get(uInt which) const
Private Members
static Double makeRad(const Quantity &in)
static Vector<Double> makeRad(const Quantum<Vector<Double> > &in)

Description

Review Status

Reviewed By:
tcornwel
Date Reviewed:
1996/02/15
Programs:
Tests:

Prerequisite

Etymology

Euler angles describe the rotation of a coordinate system

Synopsis

The Euler class is a vector of three angles, together with a vector of three signed integers. The angles describe the rotation around an axis of a coordinate system, the integers the actual axis around which to rotate. The integer can be 0 (do not use this angle) or 1,2,3 to indicate the axis. Given angles (a1,a2,a3) and axes (i1,i2,i3), the actual rotation matrix constructed will be:
R = Ri3(a3).Ri2(a2).Ri1(a1)
It has the following constructors: It has a unary minus operator, which reverses the sign and order of the three angles, and the order of the axes, to produce the Euler angles for a rotation with opposite signs, so that RotMatrix(-Euler) will generate the inverse rotation matrix as compared with RotMatrix(Euler).
getAngle() functions return the Euler angles as a Quantum vector.
Eulers have addition and subtraction (on the angles). Note that this produces the correct angles for a combined rotation only if the axes are identical.
A (which) operator returns the indicated angle. Set/get functions manipulate the axes.

Example

	Quantity angle(25,"deg");	// 25 degrees
	Euler eul(angle.get().getValue(),2); // rotate over axis 2 (radians)
	RotMatrix rot(eul); 		// generates rotation matrix

Motivation

To use generated precession and nutation results

To Do

Member Description

friend ostream &operator<<(ostream &os, const Euler &eul)

Output Euler angles

Euler()

Default constructor generates zero filled Double vector of length 3, with (1,2,3) axes

Euler(const Euler &other)

Copy constructor

Euler &operator=(const Euler &other)

Copy assignment

Euler(Double in0, Double in1 = 0, Double in2 = 0)

Constructs an Euler with specified angles and (1,2,3) axes

Euler(Double in0, uInt ax0, Double in1 = 0, uInt ax1=0, Double in2 = 0, uInt ax2=0)

Constructs an Euler with specified angles and axes

Euler(const Quantity &in0)
Euler(const Quantity &in0, const Quantity &in1)
Euler(const Quantity &in0, const Quantity &in1, const Quantity &in2)
Euler(const Quantity &in0, uInt ax0)
Euler(const Quantity &in0, uInt ax0, const Quantity &in1, uInt ax1=0)
Euler(const Quantity &in0, uInt ax0, const Quantity &in1, uInt ax1, const Quantity &in2, uInt ax2=0)

Thrown Exceptions

Constructs an Euler from specified angle quantities

Euler(const Quantum<Vector<Double> > &in)
Euler(const Quantum<Vector<Double> > &in, const Vector<uInt> &ax)

Constructs an Euler (zero filled) from elements of Quantity vector

~Euler()

Destructor

Euler operator-() const

The unary minus reverses the sign and order of the Euler angles

Euler &operator+=(const Euler &right)
Euler operator+(const Euler &right) const
Euler &operator-=(const Euler &right)
Euler operator-(const Euler &right) const

Addition and subtraction

Double &operator()(uInt which)
const Double &operator()(uInt which) const

Return the which' angle

Quantum<Vector<Double> > getAngle() const
Quantum<Vector<Double> > getAngle(const Unit &unit) const

with the optional conversion units.

void set(uInt which, uInt ax)

Set an axis

void set(uInt ax0, uInt ax1, uInt ax2)

Set all axes

Int get(uInt which) const

Get an axis

static Double makeRad(const Quantity &in)
static Vector<Double> makeRad(const Quantum<Vector<Double> > &in)

The makeRad functions check and convert the input Quantities to radians