Rotation

Shared rotation types (Quaternion, EulerAngles) and conversion helpers.

#include <rotation.hpp>

Structs

struct Quaternion

Unit quaternion describing a 3D rotation, stored as (x, y, z, w).

Defaults to the identity rotation. Helpers in this header assume a (near-)unit quaternion; use Normalize() if you are unsure.

FieldTypeDescription
x float vector part i
y float vector part j
z float vector part k
w float scalar part (identity = 1)

struct EulerAngles

Tait-Bryan Euler angles in RADIANS.

Convention: intrinsic ZYX, R = Rz(yaw) * Ry(pitch) * Rx(roll). - roll : rotation about the body X axis - pitch : rotation about the body Y axis - yaw : rotation about the body Z axis (0 = forward at power-on)

FieldTypeDescription
roll float radians, about X
pitch float radians, about Y
yaw float radians, about Z