34 #ifndef TURBOMATH_TURBOMATH_H 35 #define TURBOMATH_TURBOMATH_H 45 float atan2(
float y,
float x);
70 Vector(
float x_,
float y_,
float z_);
73 float sqrd_norm()
const;
77 float dot(
const Vector& v)
const;
82 Vector& operator*=(
float s);
83 Vector& operator/=(
float s);
108 Quaternion(
float w_,
float x_,
float y_,
float z_);
110 Quaternion(
float roll,
float pitch,
float yaw);
117 Quaternion& from_RPY(
float roll,
float pitch,
float yaw);
118 void get_RPY(
float* roll,
float* pitch,
float* yaw)
const;
127 float norm_v = v.norm();
132 out.
x = out.
y = out.
z = 0.0;
136 out = 2.0 *
atan2(norm_v, q.
w) * v / norm_v;
146 #endif // TURBOMATH_TURBOMATH_H
Vector operator*(float s, const Vector &v)
float atan2(float y, float x)
Vector operator-(const Quaternion &q) const
Vector operator/(float s, const Vector &v)
static Vector log(const Quaternion &q)