LevelS C++ support library  3.83
Public Member Functions | Related Functions | List of all members
rotmatrix Class Reference

#include <rotmatrix.h>

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 42 of file rotmatrix.h.

Constructor & Destructor Documentation

◆ rotmatrix() [1/2]

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 50 of file rotmatrix.h.

◆ rotmatrix() [2/2]

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 38 of file rotmatrix.cc.

Member Function Documentation

◆ SetToIdentity()

void rotmatrix::SetToIdentity ( )

Sets the matrix to the identity matrix.

Definition at line 45 of file rotmatrix.cc.

◆ SetToZero()

void rotmatrix::SetToZero ( )

Sets all matrix elements to zero.

Definition at line 52 of file rotmatrix.cc.

◆ Transpose()

void rotmatrix::Transpose ( )

Transposes the matrix.

Definition at line 58 of file rotmatrix.cc.

◆ toAxisAngle()

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

Extracts a unit-length rotation axis axis and a rotation angle angle (in radian) from the matrix.

Definition at line 65 of file rotmatrix.cc.

◆ Make_Axis_Rotation_Transform()

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

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

Definition at line 117 of file rotmatrix.cc.

◆ Make_CPAC_Euler_Matrix()

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 136 of file rotmatrix.cc.

◆ Extract_CPAC_Euler_Angles()

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 147 of file rotmatrix.cc.

◆ Transform() [1/2]

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

Returns the vector vec, transformed by the matrix.

Definition at line 101 of file rotmatrix.h.

◆ Transform() [2/2]

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

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

Definition at line 109 of file rotmatrix.h.


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

Generated on Wed Nov 13 2024 12:18:16 for LevelS C++ support library