rotlib 1.0.0
Loading...
Searching...
No Matches
Axis Angle

Functions

void aa_fix (double axis[3], double *angle, const bool normalize)
 Modifies axis and angle to ensure a right handed rotation with angle $\in [0, \pi)$$\in [0, \pi)$.
void aa_rand (double axis[3], double *angle)
 Generates a random orientation in axis-angle representation.
void aa_rotmat (const double axis[3], const double angle, double *rotmat)
 Calculates the rotation matrix corresponding to an axis-angle representation.
void aa_from_rotmat (const double *rotmat, double axis[3], double *angle)
 Extracts axis and angle from a rotation matrix.
void aa_rotate_vectors (const int n, const double *v, const double axis[3], const double angle, double *vrot)
 Rotates vectors about axis by angle.
void aa_shiftmat (const double axis[3], const double angle, const bool forward, double *shiftmat)
 Calculates the shifter matrix corresponding to an axis-angle representation.
void aa_shift_vectors (const int n, const double *v, const double axis[3], const double angle, 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 an axis-angle representation, shifts vectors from A to B or B to A.
void aa_shift_tensor2 (const double *A, const double axis[3], const double angle, 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 axis-angle representation, shifts second-order tensors from A to B or B to A.
void aa_shift_tensor3 (const double *A, const double axis[3], const double angle, 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 axis-angle representation, shifts third-order tensors from A to B or B to A.
void aa_to_quat (const double axis[3], const double angle, double q[4])
 Converts an axis-angle representation to a unit quaternion.
void aa_to_dcm (const double axis[3], const double angle, double *dcm)
 Converts an axis-angle representation to a direction cosine matrix.
void aa_to_euler (const double axis[3], const double angle, enum EulangSeq seq, const bool world, double euler[3])
 Converts an axis-angle representation to an Euler angle sequence.

Detailed Description

Function Documentation

◆ aa_fix()

void aa_fix ( double axis[3],
double * angle,
const bool normalize )

Modifies axis and angle to ensure a right handed rotation with angle $\in [0, \pi)$$\in [0, \pi)$.

Parameters
[in,out]axisAxis of rotation. If this is not a unit vector, set normalize to true.
[in,out]angleAngle in radian.
[in]normalizeWhether to normalize axis to a unit vector.

◆ aa_from_rotmat()

void aa_from_rotmat ( const double * rotmat,
double axis[3],
double * angle )

Extracts axis and angle from a rotation matrix.

Parameters
[in]rotmat3 x 3 rotation matrix.
[out]axisUnit vector along the axis.
[out]angleAngle in radian.

◆ aa_rand()

void aa_rand ( double axis[3],
double * angle )

Generates a random orientation in axis-angle representation.

The axis is a random vector drawn from a uniform distribution on the surface of a unit sphere. The current implementation in based on the algorithm from Allen & Tildesley p. 349.

Parameters
[out]axisAxis of rotation.
[out]angleAngle in radian.

◆ aa_rotate_vectors()

void aa_rotate_vectors ( const int n,
const double * v,
const double axis[3],
const double angle,
double * vrot )

Rotates vectors about axis by angle.

Parameters
[in]nNumber of rows of v.
[in]vn x 3 array whose rows are the vectors to rotate.
[in]axisUnit vector along the axis.
[in]angleAngle in radian. 0 <= angle < pi.
[out]vrotn x 3 array whose rows are the rotated vectors.

◆ aa_rotmat()

void aa_rotmat ( const double axis[3],
const double angle,
double * rotmat )

Calculates the rotation matrix corresponding to an axis-angle representation.

Parameters
[in]axisAxis of rotation.
[in]angleAngle in radian. 0 <= angle < pi.
[out]rotmat3 x 3 rotation matrix.

◆ aa_shift_tensor2()

void aa_shift_tensor2 ( const double * A,
const double axis[3],
const double angle,
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 axis-angle representation, shifts second-order tensors from A to B or B to A.

Parameters
[in]A3 x 3 second-order tensor.
[in]axisUnit vector along the axis.
[in]angleAngle in radian. 0 <= angle < pi.
[in]forwardWhether to shift forward, i.e., along the orientation or shift reverse.
[out]Ashift3 x 3 shifted second-order tensor.

◆ aa_shift_tensor3()

void aa_shift_tensor3 ( const double * A,
const double axis[3],
const double angle,
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 axis-angle representation, shifts third-order tensors from A to B or B to A.

Parameters
[in]A3 x 3 x 3 third-order tensor.
[in]axisUnit vector along the axis.
[in]angleAngle in radian. 0 <= angle < pi.
[in]forwardWhether to shift forward, i.e., along the orientation or shift reverse.
[out]Ashift3 x 3 x 3 shifted second-order tensor.

◆ aa_shift_vectors()

void aa_shift_vectors ( const int n,
const double * v,
const double axis[3],
const double angle,
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 an axis-angle representation, 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]axisUnit vector along the axis.
[in]angleAngle in radian. 0 <= angle < pi.
[in]forwardWhether to shift forward, i.e., along the orientation or shift reverse.
[out]vshiftn x 3 array whose rows are the rotated vectors.

◆ aa_shiftmat()

void aa_shiftmat ( const double axis[3],
const double angle,
const bool forward,
double * shiftmat )

Calculates the shifter matrix corresponding to an axis-angle representation.

Parameters
[in]axisUnit vector along the axis.
[in]angleAngle in radian. 0 <= angle < pi.
[in]forwardWhether to shift forward, i.e., along the orientation or shift reverse.
[out]shiftmat3 x 3 shifter matrix.

◆ aa_to_dcm()

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

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

Parameters
[in]axisUnit vector along the axis.
[in]angleAngle in radian. 0 <= angle < pi.
[out]dcm3 x 3 direction cosine matrix.

◆ aa_to_euler()

void aa_to_euler ( const double axis[3],
const double angle,
enum EulangSeq seq,
const bool world,
double euler[3] )

Converts an axis-angle representation to an Euler angle sequence.

Parameters
[in]axisUnit vector along the axis.
[in]angleAngle in radian. 0 <= angle < pi.
[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.

◆ aa_to_quat()

void aa_to_quat ( const double axis[3],
const double angle,
double q[4] )

Converts an axis-angle representation to a unit quaternion.

Parameters
[in]axisUnit vector along the axis.
[in]angleAngle in radian. 0 <= angle < pi.
[out]qA unit quaternion.