NASA - Jet Propulsion Laboratory
    + View the NASA Portal
Search JPL
Jet Propulsion Laboratory Home Earth Solar System Stars & Galaxies Technology
Introduction Background Software Links

rotmatrix Class Reference
[Rotation matrices]

#include <rotmatrix.h>

List of all members.

Public Member Functions

 rotmatrix (double a00, double a01, double a02, double a10, double a11, double a12, double a20, double a21, double a22)
 rotmatrix (const vec3 &a, const vec3 &b, const vec3 &c)
void SetToIdentity ()
void SetToZero ()
void Transpose ()
void toAxisAngle (vec3 &axis, double &angle) const
void Make_Axis_Rotation_Transform (const vec3 &axis, double angle)
void Make_CPAC_Euler_Matrix (double alpha, double beta, double gamma)
void Extract_CPAC_Euler_Angles (double &alpha, double &beta, double &gamma) const
vec3 Transform (const vec3 &vec) const
void Transform (const vec3 &vec, vec3 &vec2) const

Related Functions

(Note that these are not member functions.)

rotmatrix operator* (const rotmatrix &a, const rotmatrix &b)
void matmult (const rotmatrix &a, const rotmatrix &b, rotmatrix &res)
void TransposeTimes (const rotmatrix &a, const rotmatrix &b, rotmatrix &res)
std::ostream & operator<< (std::ostream &os, const rotmatrix &mat)


Detailed Description

Class for rotation transforms in 3D space

Definition at line 45 of file rotmatrix.h.


Constructor & Destructor Documentation

rotmatrix::rotmatrix ( double  a00,
double  a01,
double  a02,
double  a10,
double  a11,
double  a12,
double  a20,
double  a21,
double  a22 
) [inline]

Constructs a rotation matrix from its nine entries

Definition at line 53 of file rotmatrix.h.

rotmatrix::rotmatrix ( const vec3 a,
const vec3 b,
const vec3 c 
)

Constructs a rotation matrix so that a is the first column, b is the second column and c is the third column.

Note:
The vectors a, b and c must form an orthonormal system!

Definition at line 41 of file rotmatrix.cc.


Member Function Documentation

void rotmatrix::SetToIdentity (  ) 

Sets the matrix to the identity matrix.

Definition at line 48 of file rotmatrix.cc.

void rotmatrix::SetToZero (  ) 

Sets all matrix elements to zero.

Definition at line 55 of file rotmatrix.cc.

void rotmatrix::Transpose (  ) 

Transposes the matrix.

Definition at line 61 of file rotmatrix.cc.

void rotmatrix::toAxisAngle ( vec3 axis,
double &  angle 
) const

Extracts a unit-length rotation axis axis and a rotation angle angle from the matrix.

Definition at line 68 of file rotmatrix.cc.

void rotmatrix::Make_Axis_Rotation_Transform ( const vec3 axis,
double  angle 
) [inline]

Constructs a matrix which causes a rotation by angle around axis. axis must have unit length.

Definition at line 81 of file rotmatrix.h.

void rotmatrix::Make_CPAC_Euler_Matrix ( double  alpha,
double  beta,
double  gamma 
)

Creates a rotation matrix A, which performs the following operations on a vector v, when Av is calculated:

  1. rotate v around the z-axis by gamma,
  2. rotate v' around the y-axis by beta,
  3. rotate v'' around the z-axis by alpha.

Note:
alpha, beta and gamma are given in radians, the rotations are right handed.

This transformation rotates the vectors, not the coordinate axes!

Definition at line 121 of file rotmatrix.cc.

void rotmatrix::Extract_CPAC_Euler_Angles ( double &  alpha,
double &  beta,
double &  gamma 
) const

Extracts the Euler angles alpha, beta and gamma from the matrix. For their definition see Make_CPAC_Euler_Matrix().

Note:
In case of ambiguity alpha will be 0.

Definition at line 132 of file rotmatrix.cc.

vec3 rotmatrix::Transform ( const vec3 vec  )  const [inline]

Returns the vector vec, transformed by the matrix.

Definition at line 120 of file rotmatrix.h.

void rotmatrix::Transform ( const vec3 vec,
vec3 vec2 
) const [inline]

Returns the vector vec, transformed by the matrix, in vec2.

Definition at line 128 of file rotmatrix.h.


The documentation for this class was generated from the following files:

Generated on Fri Jun 18 16:12:29 2010 for LevelS C++ support library
Privacy / Copyright
FIRST GOV Contact: NASA Home Page Site Manager:
Webmaster:

CL 03-2650