[ GAMB | Source | Keywords | Summary | Ancestors | All Members | Descendants ]
public: | |
// define real type | |
typedef | Vector3::real real; |
// Constructors | |
Rotation3(); | |
Rotation3(const real a, const real b, const real c, const real d); | |
explicit | Rotation3(const Matrix3& m); |
Rotation3(const real& xr, const real& yr, const real& zr); | |
explicit | Rotation3(const real m[3][3]); |
explicit | Rotation3(const double m[3][3]); |
Rotation3(const Vector3& v1, const Vector3& v2, const Vector3& v3); | |
// Inspection methods and properties. | |
const real | operator[](const unsigned short index) const; |
Vector3 | row(const unsigned short r) const; |
Vector3 | column(const unsigned short col) const; |
real | element(const unsigned short r, const unsigned short col) const; |
real | rotX() const; |
real | rotY() const; |
real | rotZ() const; |
Vector3 | rotationAngles() const; |
real | trace() const; |
real | dist2(const Rotation3& r) const; |
real | dist(const Rotation3& r) const; |
// Operators | |
operator Matrix3() const; | |
Rotation3& | operator*=(const Rotation3 &); |
friend Rotation3 | operator*(const Rotation3&, const Rotation3&); |
friend Rotation3 | operator!(const Rotation3&); |
friend Vector3 | operator*(const Rotation3&, const Vector3&); |
friend ostream& | operator<<(ostream& s, const Rotation3& t); |
protected: | |
Rotation3(const real a, const real b, const real c, const real d, int); |
Copyright: SAMBA group, Tel-Aviv Univ. Israel, 1997.
Rotation3 ra(1.0, 1.1, -1.3); // rotation angles. Rotation3 rb(0.9, -2.3, 0.1); // rotation angles. Matrix3 a= ra; Matrix3 b= rb; Rotation3 rab = ra*rb; Matrix3 ab = a*b; // rab should be = to ab; Vector3 v(1.0, 2.0, 3.0); cout !rab*v;
typedef Vector3::real real;
real is defined using the real defined in Vector3 class. By default
this is of type float. For example , changing Vector3::real's defintion
to double will turn the gamb library's vector operations to double
precision.
typedef Vector3::real real;
Rotation3();
Default constructor: 0 matrix.
Rotation3();
Rotation3(const real a, const real b, const real c, const real d);
Instantiate a rotation using 4 quaternion parameters.
Rotation3(const real a, const real b, const real c, const real d);
explicit Rotation3(const Matrix3& m);
Instantiate a Rotation3 using a rotation matrix. If the matrix is not
a rotation matrix the parameters will be normalized.
explicit Rotation3(const Matrix3& m);
Rotation3(const real& xr, const real& yr, const real& zr);
Creates a Rotation3 object. given rotational angles around the
x axis (xr), around the y axis (yr) and around the z axis (zr) a
linear transformation that rotates space in the order x-y-z is created.
Rotation in this order is the default representation for the gamb++
library rotational transformations.
Rotation3(const real& xr, const real& yr, const real& zr);
explicit Rotation3(const real m[3][3]);
Use a 3x3 real 2D array matrix to initialize a Rotation3. If matrix is
not a rotation it is "normalized".
explicit Rotation3(const real m[3][3]);
explicit Rotation3(const double m[3][3]);
Use a 3x3 double prec. 2D array matrix to initialize a Rotation3. If
matrix is not a rotation it is "normalized".
explicit Rotation3(const double m[3][3]);
Rotation3(const Vector3& v1, const Vector3& v2, const Vector3& v3);
Constructs a Rotation3 using the 3 given matrix row vectors. If matrix
is not a rotation it is "normalized".
Rotation3(const Vector3& v1, const Vector3& v2, const Vector3& v3);
const real operator[](const unsigned short index) const;
Returns the ith element of quaternion representing the rotation. index
may take values from 0 to 3. Otherwise results are undefined.
const real operator[](const unsigned short index) const;
Vector3 row(const unsigned short r) const;
Returns a vector matching the r'th row of the rotation matrix
representing the rotation object . r must be in the range 1..3 or run
time errors may occur.
Vector3 row(const unsigned short r) const;
Vector3 column(const unsigned short col) const;
Returns a vector matching the col'th column of the rotation matrix
representing the rotation object . r must be in the range 1..3 or run
time errors may occur.
Vector3 column(const unsigned short col) const;
real element(const unsigned short r, const unsigned short col) const;
Returns the numerical value at position row, col in the 3X3 matrix
representing the rotation.
row, col should be within the range of 1..3 or run time errors may occur.
/ Use the matrix(ij) familiy of methods for faster access.
real element(const unsigned short r, const unsigned short col) const;
real rotX() const;
Returns the rotation around the x-axis for a rotational matrix assuming
rotations are performed in the order of x-y-z.
real rotX() const;
real rotY() const;
Returns the rotation around the y-axis for a rotational matrix assuming
rotations are performed in the order of x-y-z.
real rotY() const;
real rotZ() const;
Returns the rotation around the z-axis for a rotational matrix assuming
rotations are performed in the order of x-y-z.
real rotZ() const;
Vector3 rotationAngles() const;
Returns 3 rotation angles assuming
rotations are performed in the order of x-y-z.
Vector3 rotationAngles() const;
real trace() const;
Returns the trace of the rotation matrix representing the rotation.
real trace() const;
real dist2(const Rotation3& r) const;
Returns squared distance between 2 rotations. Currently this is
implemented by taking the euclidean distance between the 4 parameters of
the quternion.
real dist2(const Rotation3& r) const;
real dist(const Rotation3& r) const;
Returns distance between 2 rotations. Currently this is
implemented by taking the euclidean distance between the 4 parameters of
the quternion.
real dist(const Rotation3& r) const;
operator Matrix3() const;
Convert a Rotation3 object to Matrix3 type.
operator Matrix3() const;
Rotation3& operator*=(const Rotation3 &);
In place multiplication with a given rotation object.
Rotation3& operator*=(const Rotation3 &);
friend Rotation3 operator*(const Rotation3&, const Rotation3&);
Multiplication of two rotations.
friend Rotation3 operator*(const Rotation3&, const Rotation3&);
friend Rotation3 operator!(const Rotation3&);
Inverse rotation.
friend Rotation3 operator!(const Rotation3&);
friend Vector3 operator*(const Rotation3&, const Vector3&);
Rotation by vector multiplication.
friend Vector3 operator*(const Rotation3&, const Vector3&);
friend ostream& operator<<(ostream& s, const Rotation3& t);
Output rotation in quaternion format.
friend ostream& operator<<(ostream& s, const Rotation3& t);
Rotation3(const real a, const real b, const real c, const real d, int);
Instantiate a rotation using 4 quaternion parameters. This version
differs from the public version. It dows not normalize the quaternion
and does not make sure the 4 parameters actually represent a rotation.
Rotation3(const real a, const real b, const real c, const real d, int);
public: | ||
---|---|---|
// define real type | ||
typedef | Vector3::real real; | |
// Constructors | ||
explicit | Rotation3(const Matrix3& m); | |
explicit | Rotation3(const real m[3][3]); | |
explicit | Rotation3(const double m[3][3]); | |
// Inspection methods and properties. | ||
const real | operator[](const unsigned short index) const; | |
Vector3 | row(const unsigned short r) const; | |
Vector3 | column(const unsigned short col) const; | |
real | element(const unsigned short r, const unsigned short col) const; | |
real | rotX() const; | |
real | rotY() const; | |
real | rotZ() const; | |
Vector3 | rotationAngles() const; | |
real | trace() const; | |
real | dist2(const Rotation3& r) const; | |
real | dist(const Rotation3& r) const; | |
// Operators | ||
operator Matrix3() const; | ||
Rotation3& | operator*=(const Rotation3 &); | |
friend Rotation3 | operator*(const Rotation3&, const Rotation3&); | |
friend Rotation3 | operator!(const Rotation3&); | |
friend Vector3 | operator*(const Rotation3&, const Vector3&); | |
friend ostream& | operator<<(ostream& s, const Rotation3& t); | |
protected: |
Report problems to jkotula@unimax.com