24 float cos_roll = cosf(angles.
roll);
25 float sin_roll = sinf(angles.
roll);
26 float cos_pitch = cosf(angles.
pitch);
27 float sin_pitch = sinf(angles.
pitch);
28 float cos_yaw = cosf(angles.
yaw);
29 float sin_yaw = sinf(angles.
yaw);
34 dcm.
data[0][0] = cos_pitch * cos_yaw;
35 dcm.
data[0][1] = cos_yaw * sin_pitch * sin_roll - cos_roll * sin_yaw;
36 dcm.
data[0][2] = sin_roll * sin_yaw + cos_roll * cos_yaw * sin_pitch;
38 dcm.
data[1][0] = cos_pitch * sin_yaw;
39 dcm.
data[1][1] = cos_roll * cos_yaw + sin_roll * sin_pitch * sin_yaw;
40 dcm.
data[1][2] = cos_roll * sin_pitch * sin_yaw - cos_yaw * sin_roll;
42 dcm.
data[2][0] = -sin_pitch;
43 dcm.
data[2][1] = cos_pitch * sin_roll;
44 dcm.
data[2][2] = cos_pitch * cos_roll;
Basic floating point vector and matrix types and operations.
static mat3_t DCM_from_euler(const euler_angles_t angles)
Convert Euler angles to a direction cosine matrix.
Definition orientation.h:23
Definition orientation.h:11
float yaw
Definition orientation.h:14
float roll
Definition orientation.h:12
float pitch
Definition orientation.h:13
Definition linear_algebra.h:19
float data[3][3]
Definition linear_algebra.h:20