rotlib 1.0.0
Loading...
Searching...
No Matches
Direction cosine matrix

Functions

bool mat_is_dcm (const double *mat)
 Checks is a 3 x 3 array is a direction cosine matrix.
void dcm_from_axes (const double *A, const double *B, double *dcm)
 Returns the direction cosine matrix of axes(i.e. frame) B with respect to axes(i.e. frame) A.
void dcm_rotmat (const double *dcm, double *rotmat)
 Returns the rotation matrix corresponding to a direction cosine matrix.
void dcm_shiftmat (const double *dcm, const bool forward, double *shiftmat)
 Returns the shifter matrix corresponding to a direction cosine matrix.
void dcm_rotate_vectors (const int n, const double *v, const double *dcm, double *vrot)
 Rotates vectors by a direction cosine matrix.
void dcm_shift_vectors (const int n, const double *v, const double *dcm, const bool forward, double *vshift)
 Given two frames A and B such that the orientation of frame B with respect to frame A is given by a direction cosine matrix, shifts vectors from A to B or B to A.
void dcm_shift_tensor2 (const double *A, const double *dcm, const bool forward, double *Ashift)
 Given two frames A and B such that the orientation of frame B with respect to frame A is given by a direction cosine matrix, shifts second-order tensors from A to B or B to A.
void dcm_shift_tensor3 (const double *A, const double *dcm, const bool forward, double *Ashift)
 Given two frames A and B such that the orientation of frame B with respect to frame A is given by a direction cosine matrix, shifts third-order tensors from A to B or B to A.
void dcm_to_quat (const double *dcm, double q[4])
 Converts a direction cosine matrix to a unit quaternion.
void dcm_to_aa (const double *dcm, double axis[3], double *angle)
 Converts a direction cosine matrix to an axis-angle representation.
void dcm_to_euler (const double *dcm, enum EulangSeq seq, const bool world, double euler[3])
 Converts a direction cosine matrix to Euler angles.

Detailed Description

Function Documentation

◆ dcm_from_axes()

void dcm_from_axes ( const double * A,
const double * B,
double * dcm )

Returns the direction cosine matrix of axes(i.e. frame) B with respect to axes(i.e. frame) A.

Parameters
[in]A3 x 3 array. The rows of A represent the orthonormal basis vectors of frame A.
[in]B3 x 3 array. The rows of B represent the orthonormal basis vectors of frame B.
[out]dcm3 x 3 direction cosine matrix.

◆ dcm_rotate_vectors()

void dcm_rotate_vectors ( const int n,
const double * v,
const double * dcm,
double * vrot )

Rotates vectors by a direction cosine matrix.

Parameters
[in]nNumber of rows of v.
[in]vn x 3 array whose rows are the vectors to rotate.
[in]dcm3 x 3 direction cosine matrix.
[out]vrotn x 3 array whose rows are the rotated vectors.

◆ dcm_rotmat()

void dcm_rotmat ( const double * dcm,
double * rotmat )

Returns the rotation matrix corresponding to a direction cosine matrix.

Parameters
[in]dcm3 x 3 direction cosine matrix.
[out]rotmat3 x 3 rotation matrix.

◆ dcm_shift_tensor2()

void dcm_shift_tensor2 ( const double * A,
const double * dcm,
const bool forward,
double * Ashift )

Given two frames A and B such that the orientation of frame B with respect to frame A is given by a direction cosine matrix, shifts second-order tensors from A to B or B to A.

Parameters
[in]A3 x 3 second-order tensor.
[in]dcm3 x 3 direction cosine matrix.
[in]forwardWhether to shift forward, i.e., along the orientation or shift reverse.
[out]Ashift3 x 3 shifted second-order tensor.

◆ dcm_shift_tensor3()

void dcm_shift_tensor3 ( const double * A,
const double * dcm,
const bool forward,
double * Ashift )

Given two frames A and B such that the orientation of frame B with respect to frame A is given by a direction cosine matrix, shifts third-order tensors from A to B or B to A.

Parameters
[in]A3 x 3 x 3 third-order tensor.
[in]dcm3 x 3 direction cosine matrix.
[in]forwardWhether to shift forward, i.e., along the orientation or shift reverse.
[out]Ashift3 x 3 x 3 shifted third-order tensor.

◆ dcm_shift_vectors()

void dcm_shift_vectors ( const int n,
const double * v,
const double * dcm,
const bool forward,
double * vshift )

Given two frames A and B such that the orientation of frame B with respect to frame A is given by a direction cosine matrix, shifts vectors from A to B or B to A.

Parameters
[in]nNumber of rows of v.
[in]vn x 3 array whose rows are the vectors to shift.
[in]dcm3 x 3 direction cosine matrix.
[in]forwardWhether to shift forward, i.e., along the orientation or shift reverse.
[out]vshiftn x 3 array whose rows are the rotated vectors.

◆ dcm_shiftmat()

void dcm_shiftmat ( const double * dcm,
const bool forward,
double * shiftmat )

Returns the shifter matrix corresponding to a direction cosine matrix.

Parameters
[in]dcm3 x 3 direction cosine matrix.
[in]forwardWhether to shift forward, i.e., along the orientation or shift reverse.
[out]shiftmat3 x 3 shifter matrix.

◆ dcm_to_aa()

void dcm_to_aa ( const double * dcm,
double axis[3],
double * angle )

Converts a direction cosine matrix to an axis-angle representation.

Parameters
[in]dcm3 x 3 direction cosine matrix.
[in]axisUnit vector along the axis.
[in]angleAngle in radian.

◆ dcm_to_euler()

void dcm_to_euler ( const double * dcm,
enum EulangSeq seq,
const bool world,
double euler[3] )

Converts a direction cosine matrix to Euler angles.

Parameters
[in]dcm3 x 3 direction cosine matrix.
[in]seqES_XYZ | ES_XZY | ES_YXZ | ES_YZX | ES_ZXY | ES_ZYX.
Euler angle sequence.
[in]worldWhether the Euler angles are with respect to the world frame or not.
[out]eulerEuler angles.

◆ dcm_to_quat()

void dcm_to_quat ( const double * dcm,
double q[4] )

Converts a direction cosine matrix to a unit quaternion.

Parameters
[in]dcm3 x 3 direction cosine matrix.
[in]qA unit quaternion.

◆ mat_is_dcm()

bool mat_is_dcm ( const double * mat)

Checks is a 3 x 3 array is a direction cosine matrix.

Parameters
[in]mat3 x 3 array.
Returns
true if a (3,3) matrix is a direction cosine matrix.