|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
|


Go to the source code of this file.
Classes | |
| class | Quaternion |
| Quaternion storage and rotation algebra used by OPALX geometry code. More... | |
Typedefs | |
| typedef Quaternion | Quaternion_t |
Functions | |
| Quaternion | getQuaternion (ippl::Vector< double, 3 > vec, ippl::Vector< double, 3 > reference) |
Return a unit quaternion that rotates vec onto reference. | |
| typedef Quaternion Quaternion_t |
Definition at line 126 of file Quaternion.hpp.
| Quaternion getQuaternion | ( | ippl::Vector< double, 3 > | vec, |
| ippl::Vector< double, 3 > | reference | ||
| ) |
Return a unit quaternion that rotates vec onto reference.
Both input vectors are normalized internally. For the generic case, the quaternion is built from the rotation axis \(\mathbf{a} \propto \mathbf{vec} \times \mathbf{reference}\) and the half-angle formula. For antiparallel vectors the current implementation chooses an arbitrary orthogonal axis, so the 180-degree rotation is valid but not deterministic.
Definition at line 35 of file Quaternion.cpp.
References cross(), dot(), and Physics::pi.
Referenced by ParticleContainer< T, Dim >::applyFractionalStep(), ParallelTracker::computeSpaceChargeFields(), Monitor::driftToCorrectPositionAndSave(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and ParticleContainer< T, Dim >::updateRefToLabCSTrafo().
