|
C Attitude Math Library
Quaternion, Euler, and DCM math utilities for attitude control.
|
Go to the source code of this file.
Functions | |
| void | dcm_apply (const double dcm[3][3], const double vin[3], double vout[3]) |
| Apply a DCM to a vector. | |
| int | dcm_is_orthonormal (const double dcm[3][3], double tol) |
| Check whether a DCM is orthonormal within a tolerance. | |
| void | dcm_to_euler (const double dcm[3][3], double *roll, double *pitch, double *yaw) |
| Convert a direction cosine matrix to intrinsic ZYX Euler angles. | |
| int | dcm_to_euler_checked (const double dcm[3][3], double *roll, double *pitch, double *yaw) |
| Checked DCM-to-Euler conversion. | |
| void | dcm_to_quaternion (const double dcm[3][3], double q[4]) |
| Convert a DCM to a quaternion. | |
| int | dcm_to_quaternion_checked (const double dcm[3][3], double q[4]) |
| Checked DCM-to-quaternion conversion. | |
| void dcm_apply | ( | const double | dcm[3][3], |
| const double | vin[3], | ||
| double | vout[3] | ||
| ) |
Apply a DCM to a vector.
Computes \( v_{\text{out}} = \mathbf{C} \, v_{\text{in}} \).
| dcm | Rotation matrix. |
| vin | Input vector. |
| vout | Output rotated vector. |
Definition at line 125 of file dcm.c.
| int dcm_is_orthonormal | ( | const double | dcm[3][3], |
| double | tol | ||
| ) |
Check whether a DCM is orthonormal within a tolerance.
| dcm | Input rotation matrix. |
| tol | Acceptable deviation from orthonormality. |
Definition at line 5 of file dcm.c.
| void dcm_to_euler | ( | const double | dcm[3][3], |
| double * | roll, | ||
| double * | pitch, | ||
| double * | yaw | ||
| ) |
Convert a direction cosine matrix to intrinsic ZYX Euler angles.
Output angles are in radians using the aerospace yaw→pitch→roll convention.
| dcm | Input \(3\times3\) rotation matrix (row-major). |
| roll | Output rotation about the x-axis (rad). |
| pitch | Output rotation about the y-axis (rad). |
| yaw | Output rotation about the z-axis (rad). |
Definition at line 65 of file dcm.c.
| int dcm_to_euler_checked | ( | const double | dcm[3][3], |
| double * | roll, | ||
| double * | pitch, | ||
| double * | yaw | ||
| ) |
Checked DCM-to-Euler conversion.
Gimbal-lock inputs use the canonical solution roll = 0 while preserving the represented orientation.
Definition at line 44 of file dcm.c.
| void dcm_to_quaternion | ( | const double | dcm[3][3], |
| double | q[4] | ||
| ) |
Convert a DCM to a quaternion.
| dcm | Input rotation matrix. |
| q | Output quaternion in \([w, x, y, z]\) order. |
Definition at line 117 of file dcm.c.
| int dcm_to_quaternion_checked | ( | const double | dcm[3][3], |
| double | q[4] | ||
| ) |
Checked DCM-to-quaternion conversion.
Definition at line 73 of file dcm.c.