#include <cmath>
#include <type_traits>
Go to the source code of this file.
Classes | |
class | Quaternion |
Quaternions are an extension of real numbers used to represent rotations in 3D. More... | |
class | DualQuaternion |
Functions | |
const Quaternion | operator+ (const Quaternion &a, const Quaternion &b) |
Returns a Quaternion that is the sum of quaternions a and b (component-wise sum). More... | |
const Quaternion | operator* (const Quaternion &a, const Quaternion &b) |
Quaternion multiplication. More... | |
const Quaternion | conjugate (const Quaternion &q) |
const DualQuaternion | operator* (const DualQuaternion &a, const DualQuaternion &b) |
const DualQuaternion | conjugateDual (const DualQuaternion &dq) |
|
inline |
|
inline |
Both quaternion and dual number conjugation.
|
inline |
Quaternion multiplication.
|
inline |
In short: the idea of POD (plain old datatypes) classes is to support static initialization and have the same memory layout as in C. C++11 says a class is POD if it is both trivial and standard layout. It is ok to use memcpy over trivial classes. Standard layout class has the same memory layout as the equivalent C struct.
a*b = (a0 + eps*ae)*(b0 + eps*be) = a0*b0 + eps*(a0*be + ae*b0)
|
inline |
Returns a Quaternion that is the sum of quaternions a and b (component-wise sum).