OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
Quaternion.hpp File Reference
#include "Algorithms/Matrix.h"
#include "Ippl.h"
Include dependency graph for Quaternion.hpp:
This graph shows which files directly or indirectly include this file:

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 Documentation

◆ Quaternion_t

Definition at line 126 of file Quaternion.hpp.

Function Documentation

◆ getQuaternion()

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().

Here is the call graph for this function: