Array utils specifically for handling quaternions. More...
Functions | |
std::vector< std::array< double, 3 > > | rotateVectorOfPositions (const std::array< double, 4 > &q, const std::vector< std::array< double, 3 > > &positionVector) |
Rotates a std::vector of 3D positions. | |
std::array< double, 3 > | rotatePosition (const std::array< double, 4 > &q, const std::array< double, 3 > &pos) |
Rotates a single 3D position. | |
std::array< double, 3 > | rotatePositionBackwards (const std::array< double, 4 > &q, const std::array< double, 3 > &pos) |
Rotates a single 3D position backwards. | |
std::array< double, 4 > | qMul (const std::array< double, 4 > &q1, const std::array< double, 4 > &q2) |
Quaternion multiplication. | |
std::array< double, 4 > | qMul (const std::array< double, 4 > &q, const std::array< double, 3 > &v) |
Quaternion multiplication (converting v into a quaternion (0,v)) | |
std::array< double, 4 > | qMul (const std::array< double, 3 > &v, const std::array< double, 4 > &q) |
Quaternion multiplication (converting v into a quaternion (0,v)) | |
std::array< double, 4 > | qConjugate (const std::array< double, 4 > &q) |
Quaternion conjugation. | |
std::array< double, 3 > | convertQuaternionTo3DVec (const std::array< double, 4 > &q) |
Convert quaternion to 3d-vec. | |
std::array< double, 4 > | qMirror (const std::array< double, 4 > &q, const int &dimensionNormalToMirror) |
Calculate the quaternion representing the same rotation, but mirrored. | |
Array utils specifically for handling quaternions.
std::array< double, 3 > autopas::utils::quaternion::convertQuaternionTo3DVec | ( | const std::array< double, 4 > & | q | ) |
Convert quaternion to 3d-vec.
q | quaternion |
std::array< double, 4 > autopas::utils::quaternion::qConjugate | ( | const std::array< double, 4 > & | q | ) |
Quaternion conjugation.
q | quaternion |
std::array< double, 4 > autopas::utils::quaternion::qMirror | ( | const std::array< double, 4 > & | q, |
const int & | dimensionNormalToMirror | ||
) |
Calculate the quaternion representing the same rotation, but mirrored.
q | quaternion to be mirrored |
dimensionNormalToMirror | dimension normal to mirror plane |
std::array< double, 4 > autopas::utils::quaternion::qMul | ( | const std::array< double, 3 > & | v, |
const std::array< double, 4 > & | q | ||
) |
Quaternion multiplication (converting v into a quaternion (0,v))
v | 3D-vector |
q | quaternion |
std::array< double, 4 > autopas::utils::quaternion::qMul | ( | const std::array< double, 4 > & | q, |
const std::array< double, 3 > & | v | ||
) |
Quaternion multiplication (converting v into a quaternion (0,v))
q | quaternion |
v | 3D-vector |
std::array< double, 4 > autopas::utils::quaternion::qMul | ( | const std::array< double, 4 > & | q1, |
const std::array< double, 4 > & | q2 | ||
) |
Quaternion multiplication.
See Hamiltonian Product: https://en.wikipedia.org/wiki/Quaternion#Hamilton_product.
q1 | quaternion 1 |
q2 | quaternion 2 |
std::array< double, 3 > autopas::utils::quaternion::rotatePosition | ( | const std::array< double, 4 > & | q, |
const std::array< double, 3 > & | pos | ||
) |
Rotates a single 3D position.
q | Quaternion defining rotation |
pos | array of 3 doubles, defining position |
std::array< double, 3 > autopas::utils::quaternion::rotatePositionBackwards | ( | const std::array< double, 4 > & | q, |
const std::array< double, 3 > & | pos | ||
) |
Rotates a single 3D position backwards.
q | Quaternion defining rotation |
pos | array of 3 doubles, defining position |
std::vector< std::array< double, 3 > > autopas::utils::quaternion::rotateVectorOfPositions | ( | const std::array< double, 4 > & | q, |
const std::vector< std::array< double, 3 > > & | positionVector | ||
) |
Rotates a std::vector of 3D positions.
q | Quaternion defining rotation |
positionVector | std::vector of arrays of 3 doubles, defining positions |