10#ifndef INFUSE_SDK_INCLUDE_INFUSE_MATH_COMMON_H_
11#define INFUSE_SDK_INCLUDE_INFUSE_MATH_COMMON_H_
31#define math_abs(x) ((x) < 0 ? -(x) : (x))
uint16_t math_sqrt32(uint32_t x)
Compute square root of unsigned 32 bit number.
uint32_t math_bitmask_get_next_bits(uint32_t bitmask, uint8_t start_idx, uint8_t *next_idx, uint8_t num_bits)
Get the next N bits of a bitmask, with rollover.
float math_inverse_sqrt32(float x)
Fast inverse square root.
uint16_t math_vector_xyz_magnitude(int16_t x, int16_t y, int16_t z)
Compute the magnitude of an XYZ vector.
uint32_t math_vector_xyz_sq_magnitude(int16_t x, int16_t y, int16_t z)
Compute the squared magnitude of an XYZ vector.
uint8_t math_sqrt16(uint16_t x)
Compute square root of unsigned 16 bit number.
uint32_t math_vector_xy_sq_magnitude(int16_t x, int16_t y)
Compute the squared magnitude of an XY vector.
uint16_t math_vector_xy_magnitude(int16_t x, int16_t y)
Compute the magnitude of an XY vector.
int64_t math_vector_xyz_dot_product(int16_t ax, int16_t ay, int16_t az, int16_t bx, int16_t by, int16_t bz)
Compute the dot product of two XYZ vectors.
uint32_t math_sqrt64(uint64_t x)
Compute square root of unsigned 64 bit number.
int32_t math_vector_xyz_dot_product_fast(int16_t ax, int16_t ay, int16_t az, int16_t bx, int16_t by, int16_t bz)
Compute the dot product of two XYZ vectors.