API — ICoreBlocks/ICoreMath/Geometry
The public contract of 1 header(s) under src/ICoreBlocks/ICoreMath/Geometry — 1 class/struct definition(s), 10 declaration(s). Each section shows the header's banner and its public (and protected-virtual) surface exactly as the file writes it.
| Header | Defines | Declarations | Bases |
|---|---|---|---|
ICoreQuaternion.h | ICoreQuaternion | 10 | — |
ICoreQuaternion.h#
src/ICoreBlocks/ICoreMath/Geometry/ICoreQuaternion.h
ICoreQuaternion#
ICoreQuaternion.h:9 · class · 10 declaration(s)
Rotation representation, backed by Eigen::Quaterniond / Eigen::AngleAxisd.
class ICoreQuaternion {
public:
// axis: 3x1 vector (need not be unit length); angle in radians.
// Returns a 4x1 quaternion [w,x,y,z].
static ICoreMatrix fromAxisAngle(const ICoreMatrix& axis, const double& angle);
// a,b,c: Euler angles in radians, applied about axis0 then axis1 then axis2
// (axis index: 0=x, 1=y, 2=z), matching Eigen's eulerAngles() convention.
// E.g. axis0=2,axis1=1,axis2=0 is the aerospace ZYX yaw-pitch-roll order.
// Returns a 4x1 quaternion [w,x,y,z].
static ICoreMatrix fromEuler(const double& a, const double& b, const double& c,
const size_t& axis0, const size_t& axis1, const size_t& axis2);
// R: 3x3 rotation matrix. Returns a 4x1 quaternion [w,x,y,z].
static ICoreMatrix fromRotationMatrix(const ICoreMatrix& R);
// q: 4x1 [w,x,y,z]. Returns a 3x3 rotation matrix.
static ICoreMatrix toRotationMatrix(const ICoreMatrix& q);
// q: 4x1 [w,x,y,z]. Returns a 3x1 vector of Euler angles about axis0,axis1,axis2.
static ICoreMatrix toEuler(const ICoreMatrix& q, const size_t& axis0, const size_t& axis1, const size_t& axis2);
// Hamilton product q1*q2: applying the result to a vector rotates by q2 first,
// then by q1 (i.e. composes "q1 after q2").
static ICoreMatrix multiply(const ICoreMatrix& q1, const ICoreMatrix& q2);
static ICoreMatrix conjugate(const ICoreMatrix& q);
static ICoreMatrix inverse(const ICoreMatrix& q);
static ICoreMatrix normalize(const ICoreMatrix& q);
// Spherical linear interpolation between q1 and q2, t in [0,1].
static ICoreMatrix slerp(const ICoreMatrix& q1, const ICoreMatrix& q2, const double& t);
// Rotate a 3x1 vector v by quaternion q.
static ICoreMatrix rotateVector(const ICoreMatrix& q, const ICoreMatrix& v);
};
};