|
rotlib 1.0.0
|
Functions | |
| void | quat_rand (double q[4]) |
| Creates a unit quarternion with random orientation. | |
| void | quat_identity (double q[4]) |
| Creates an identity quarternion. | |
| void | quat_conjugated (double q[4]) |
| Performs in-place conjugation of a quaternion. | |
| void | quat_inverted (double q[4]) |
| Performs in-place inversion of a quaternion. | |
| void | quat_normalized (double q[4]) |
| Performs in-place normalization of a quaternion. | |
| bool | quat_is_normalized (const double q[4]) |
| Returns true if a quaternion is normalized, i.e. if it is a unit quaternion. | |
| void | quat_prod (const double p[4], const double q[4], double pq[4], bool normalize) |
| Calculates the product of two unit quaternions. | |
| double | quat_angle_between (const double p[4], const double q[4]) |
| Returns the angle between two unit quaternions. | |
| void | quat_interpolate (const double q1[4], const double q2[4], const double t, double q[4]) |
| Interpolates between two unit quaternions. | |
| void | quat_deriv_to_angvel_mat (const double q[4], double *mat) |
| Returns the matrix mapping the derivative of a unit quaternion to angular velocity. | |
| void | quat_deriv_to_angvel (const double q[4], const double qdot[4], double angvel[3]) |
| Calculates the angular velocity from a unit quaternion and its time derivative. | |
| void | quat_deriv_from_angvel_mat (const double q[4], double *mat) |
| Returns the matrix mapping the angular velocity to the time derivative of a unit quaternion. | |
| void | quat_deriv_from_angvel (const double q[4], const double angvel[3], double qdot[4]) |
| Calculates the time derivative of a unit quaternion from angular velocity. | |
| void | quat_rotmat (const double q[4], double *rotmat) |
| Calculates the rotation matrix corresponding to a unit quaternion. | |
| void | quat_shiftmat (const double q[4], const bool forward, double *shiftmat) |
| Calculates the shifter matrix corresponding to a unit quaternion. | |
| void | quat_rotate_vectors (const int n, const double *v, const double q[4], double *vrot) |
| Rotates vectors by a unit quaternion. | |
| void | quat_shift_vectors (const int n, const double *v, const double q[4], 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 unit quaternion, shifts vectors from A to B or B to A. | |
| void | quat_shift_tensor2 (const double *A, const double q[4], 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 unit quaternion, shifts second-order tensors from A to B or B to A. | |
| void | quat_shift_tensor3 (const double *A, const double q[4], 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 unit quaternion, shifts third-order tensors from A to B or B to A. | |
| void | quat_to_aa (const double q[4], double axis[3], double *angle) |
| Converts a unit quaternion to an axis-angle representation. | |
| void | quat_to_dcm (const double q[4], double *dcm) |
| Converts a unit quaternion to a direction cosine matrix. | |
| void | quat_to_euler (const double q[4], enum EulangSeq seq, const bool world, double euler[3]) |
| Converts a unit quaternion to an Euler angle sequence. | |
| double quat_angle_between | ( | const double | p[4], |
| const double | q[4] ) |
Returns the angle between two unit quaternions.
| [in] | p | A quaternion. |
| [in] | q | Another quaternion. |
| void quat_conjugated | ( | double | q[4] | ) |
Performs in-place conjugation of a quaternion.
| [in,out] | q | in: A quaternion. out: The quaternion q conjugated. |
| void quat_deriv_from_angvel | ( | const double | q[4], |
| const double | angvel[3], | ||
| double | qdot[4] ) |
Calculates the time derivative of a unit quaternion from angular velocity.
| [in] | q | A unit quaternion. |
| [in] | angvel | Angular velocity. |
| [out] | qdot | Time derivative of q. |
| void quat_deriv_from_angvel_mat | ( | const double | q[4], |
| double * | mat ) |
Returns the matrix mapping the angular velocity to the time derivative of a unit quaternion.
| [in] | q | A unit quaternion. |
| [out] | mat | The 4 x 3 quaternion derivative matrix. |
| void quat_deriv_to_angvel | ( | const double | q[4], |
| const double | qdot[4], | ||
| double | angvel[3] ) |
Calculates the angular velocity from a unit quaternion and its time derivative.
| [in] | q | A unit quaternion. |
| [in] | qdot | Time derivative of q. |
| [out] | angvel | Angular velocity. |
| void quat_deriv_to_angvel_mat | ( | const double | q[4], |
| double * | mat ) |
Returns the matrix mapping the derivative of a unit quaternion to angular velocity.
| [in] | q | Derivative of a unit quaternion. |
| [out] | mat | The 3 x 4 angular velocity matrix. |
| void quat_identity | ( | double | q[4] | ) |
Creates an identity quarternion.
| [out] | q | Identity quaternion. |
| void quat_interpolate | ( | const double | q1[4], |
| const double | q2[4], | ||
| const double | t, | ||
| double | q[4] ) |
Interpolates between two unit quaternions.
| [in] | q1 | A unit quaternion. |
| [in] | q2 | Another unit quaternion. |
| [in] | t | Interpolation factor, 0 <= t <= 1. |
| [out] | q | Interpolated unit quaternion. |
| void quat_inverted | ( | double | q[4] | ) |
Performs in-place inversion of a quaternion.
| [in,out] | q | in: A quaternion. out: The quaternion q inverted. |
| bool quat_is_normalized | ( | const double | q[4] | ) |
Returns true if a quaternion is normalized, i.e. if it is a unit quaternion.
| [in] | q | A quaternion. |
| void quat_normalized | ( | double | q[4] | ) |
Performs in-place normalization of a quaternion.
| [in,out] | q | in: A quaternion. out: The quaternion q normalized. |
| void quat_prod | ( | const double | p[4], |
| const double | q[4], | ||
| double | pq[4], | ||
| bool | normalize ) |
Calculates the product of two unit quaternions.
| [in] | p | A quaternion. |
| [in] | q | Another quaternion. |
| [out] | pq | Product of p and q. |
| [in] | normalize | Whether to normalize the product. |
| void quat_rand | ( | double | q[4] | ) |
Creates a unit quarternion with random orientation.
| [out] | q | The unit quaternion. |
| void quat_rotate_vectors | ( | const int | n, |
| const double * | v, | ||
| const double | q[4], | ||
| double * | vrot ) |
Rotates vectors by a unit quaternion.
| [in] | n | Number of rows of v. |
| [in] | v | n x 3 array whose rows are the vectors to rotate. |
| [in] | q | A unit quaternion. |
| [out] | vrot | n x 3 array whose rows are the rotated vectors. |
| void quat_rotmat | ( | const double | q[4], |
| double * | rotmat ) |
Calculates the rotation matrix corresponding to a unit quaternion.
| [in] | q | A unit quaternion. |
| [out] | rotmat | 3 x 3 rotation matrix. |
| void quat_shift_tensor2 | ( | const double * | A, |
| const double | q[4], | ||
| 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 unit quaternion, shifts second-order tensors from A to B or B to A.
| [in] | A | 3 x 3 second-order tensor. |
| [in] | q | A unit quaternion. |
| [in] | forward | Whether to shift forward, i.e., along the orientation or shift reverse. |
| [out] | Ashift | 3 x 3 shifted second-order tensor. |
| void quat_shift_tensor3 | ( | const double * | A, |
| const double | q[4], | ||
| 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 unit quaternion, shifts third-order tensors from A to B or B to A.
| [in] | A | 3 x 3 x 3 third-order tensor. |
| [in] | q | A unit quaternion. |
| [in] | forward | Whether to shift forward, i.e., along the orientation or shift reverse. |
| [out] | Ashift | 3 x 3 x 3 shifted third-order tensor. |
| void quat_shift_vectors | ( | const int | n, |
| const double * | v, | ||
| const double | q[4], | ||
| 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 unit quaternion, shifts vectors from A to B or B to A.
| [in] | n | Number of rows of v. |
| [in] | v | n x 3 array whose rows are the vectors to shift. |
| [in] | q | A unit quaternion. |
| [in] | forward | Whether to shift forward, i.e., along the orientation or shift reverse. |
| [out] | vshift | n x 3 array whose rows are the rotated vectors. |
| void quat_shiftmat | ( | const double | q[4], |
| const bool | forward, | ||
| double * | shiftmat ) |
Calculates the shifter matrix corresponding to a unit quaternion.
| [in] | q | A unit quaternion. |
| [in] | forward | Whether to shift forward, i.e., along the orientation or shift reverse. |
| [out] | shiftmat | 3 x 3 shifter matrix. |
| void quat_to_aa | ( | const double | q[4], |
| double | axis[3], | ||
| double * | angle ) |
Converts a unit quaternion to an axis-angle representation.
| [in] | q | A unit quaternion. |
| [out] | axis | Unit vector along the axis of rotation. |
| [out] | angle | Angle in radian. |
| void quat_to_dcm | ( | const double | q[4], |
| double * | dcm ) |
Converts a unit quaternion to a direction cosine matrix.
| [in] | q | A unit quaternion. |
| [out] | dcm | 3 x 3 direction cosine matrix. |
| void quat_to_euler | ( | const double | q[4], |
| enum EulangSeq | seq, | ||
| const bool | world, | ||
| double | euler[3] ) |
Converts a unit quaternion to an Euler angle sequence.
| [in] | q | A unit quaternion. |
| [in] | seq | ES_XYZ | ES_XZY | ES_YXZ | ES_YZX | ES_ZXY | ES_ZYX. Euler angle sequence. |
| [in] | world | Whether the Euler angles are with respect to the world frame or not. |
| [out] | euler | Euler angles. |