70#define IDENTITY_QUAT ((QUAT) {1.0f, 0.0f, 0.0f, 0.0f })
81#define util_set_bit( orig, idx ) ( orig | ( 1 << idx ) )
91#define rad_to_deg(x) ((x) * 57.29577951f)
101#define deg_to_rad(x) ((x) * 0.01745329252f)
114#define array_size( array ) ( sizeof( array ) / sizeof( array[0] ) )
bool vector_normalize(VECTOR_3F *vector)
Normalizes a three-dimensional vector in place.
Definition math_sdr.c:403
QUAT quat_conj(QUAT q)
Computes the conjugate of a quaternion.
Definition math_sdr.c:279
QUAT eul_to_quat(float yaw, float pitch, float roll)
Converts ZYX Euler angles to a quaternion.
Definition math_sdr.c:99
bool quat_is_finite(QUAT quaternion)
Determines whether every quaternion component is finite.
Definition math_sdr.c:349
QUAT quat_rotate_body_to_world(QUAT attitude, QUAT vector_body)
Rotates a vector from the body frame into the world frame.
Definition math_sdr.c:330
uint32_t crc32(const uint8_t *data, size_t len)
Computes a CRC-32 checksum over a block of data.
Definition math_sdr.c:39
VECTOR_3F vector_scale(VECTOR_3F vector, float scalar)
Scales a three-dimensional vector by a scalar.
Definition math_sdr.c:479
QUAT quat_add(QUAT a, QUAT b)
Adds two quaternions component-wise.
Definition math_sdr.c:185
float clamp_float(float value, float minimum, float maximum)
Clamps a floating-point value between minimum and maximum bounds.
Definition math_sdr.c:63
float vector_magnitude(VECTOR_3F vector)
Calculates the magnitude of a three-dimensional vector.
Definition math_sdr.c:386
QUAT quat_mult(QUAT a, QUAT b)
Hamilton product of two quaternions.
Definition math_sdr.c:135
VECTOR_3F vector_cross(VECTOR_3F a, VECTOR_3F b)
Calculates the cross product of two three-dimensional vectors.
Definition math_sdr.c:439
QUAT quat_normalize(QUAT q)
Normalizes a quaternion to unit length.
Definition math_sdr.c:242
bool vector_is_finite(VECTOR_3F vector)
Determines whether every vector component is finite.
Definition math_sdr.c:369
VECTOR_3F vector_add(VECTOR_3F a, VECTOR_3F b)
Adds two three-dimensional vectors.
Definition math_sdr.c:459
QUAT quat_rotate_world_to_body(QUAT attitude, QUAT vector_world)
Rotates a vector from the world frame into the body frame.
Definition math_sdr.c:301
QUAT quat_scale(QUAT q, float s)
Scales a quaternion by a scalar value.
Definition math_sdr.c:211
float quat_dot(QUAT a, QUAT b)
Provides the dot product of two quaternions.
Definition math_sdr.c:163
struct _VECTOR_3F VECTOR_3F
Three-dimensional floating-point vector.
Three-dimensional floating-point vector.
Definition math_sdr.h:60