20 #ifndef RC_QUATERNION_H
21 #define RC_QUATERNION_H
27 #include <rc/math/vector.h>
28 #include <rc/math/matrix.h>
int rc_normalize_quaternion_array(double q[4])
Normalizes a quaternion in-place to have length 1.0.
Definition: quaternion.c:60
int rc_quaternion_rotate(rc_vector_t *p, rc_vector_t q)
Rotates the quaternion p by quaternion q with the operation p'=qpq*.
Definition: quaternion.c:331
int rc_quaternion_to_rotation_matrix(rc_vector_t q, rc_matrix_t *m)
Converts a normalized quaternion to a 3x3 orthogonal rotation matrix.
Definition: quaternion.c:447
int rc_quaternion_conjugate_inplace(rc_vector_t *q)
Calculates conjugate of quaternion q and overwrites the old q.
Definition: quaternion.c:185
int rc_quaternion_from_tb_array(double tb[3], double q[4])
Calculates quaternion vector q from tait-bryan angles tb.
Definition: quaternion.c:135
int rc_quaternion_multiply_array(double a[4], double b[4], double c[4])
Calculates the quaternion Hamilton product ab=c.
Definition: quaternion.c:296
int rc_quaternion_rotate_vector(rc_vector_t *v, rc_vector_t q)
Rotate a 3D vector v in-place about the origin by quaternion q by converting v to a quaternion and pe...
Definition: quaternion.c:387
int rc_quaternion_from_tb(rc_vector_t tb, rc_vector_t *q)
Calculates quaternion vector q from tait-bryan angles tb.
Definition: quaternion.c:116
int rc_quaternion_to_tb(rc_vector_t q, rc_vector_t *tb)
Calculates 321 Tait Bryan angles in array order XYZ with operation order 321(yaw-Z,...
Definition: quaternion.c:79
int rc_quaternion_rotate_array(double p[4], double q[4])
Rotates the quaternion p by quaternion q with the operation p'=qpq*.
Definition: quaternion.c:367
int rc_quaternion_conjugate_array_inplace(double q[4])
Calculates conjugate of quaternion q and overwrites the old q.
Definition: quaternion.c:218
int rc_quaternion_multiply(rc_vector_t a, rc_vector_t b, rc_vector_t *c)
Calculates the quaternion Hamilton product ab=c.
Definition: quaternion.c:252
int rc_quaternion_to_tb_array(double q[4], double tb[3])
Calculates 321 Tait Bryan angles in array order XYZ with operation order 321(yaw-Z,...
Definition: quaternion.c:98
int rc_quaternion_imaginary_part(rc_vector_t q, rc_vector_t *img)
Populates vector i with the imaginary components ijk of of quaternion vector q.
Definition: quaternion.c:231
double rc_quaternion_norm(rc_vector_t q)
Returns the length of a quaternion vector by finding its 2-norm.
Definition: quaternion.c:18
int rc_normalize_quaternion(rc_vector_t *q)
Normalizes a quaternion in-place to have length 1.0.
Definition: quaternion.c:41
int rc_quaternion_conjugate_array(double q[4], double c[4])
Calculates conjugate of quaternion q.
Definition: quaternion.c:204
double rc_quaternion_norm_array(double q[4])
Returns the length of a quaternion vector by finding its 2-norm.
Definition: quaternion.c:28
int rc_quaternion_rotate_vector_array(double v[3], double q[4])
Rotate a 3D vector v in-place about the origin by quaternion q by converting v to a quaternion and pe...
Definition: quaternion.c:424
int rc_quaternion_conjugate(rc_vector_t q, rc_vector_t *c)
Calculates conjugate of quaternion q.
Definition: quaternion.c:161
Struct containing the state of a matrix and a pointer to dynamically allocated memory to hold its con...
Definition: matrix.h:32
Struct containing the state of a vector and a pointer to dynamically allocated memory to hold its con...
Definition: vector.h:41