SpECTRE
v2025.03.17
|
Spatial rotation in three dimensions using Euler angles. More...
#include <Rotation.hpp>
Public Member Functions | |
Rotation (double rotation_about_z, double rotation_about_rotated_y, double rotation_about_rotated_z) | |
Constructor. More... | |
Rotation (const Rotation &)=default | |
Rotation & | operator= (const Rotation &)=default |
Rotation (Rotation &&)=default | |
Rotation & | operator= (Rotation &&)=default |
template<typename T > | |
std::array< tt::remove_cvref_wrap_t< T >, 3 > | operator() (const std::array< T, 3 > &source_coords) const |
std::optional< std::array< double, 3 > > | inverse (const std::array< double, 3 > &target_coords) const |
template<typename T > | |
tnsr::Ij< tt::remove_cvref_wrap_t< T >, 3, Frame::NoFrame > | jacobian (const std::array< T, 3 > &source_coords) const |
template<typename T > | |
tnsr::Ij< tt::remove_cvref_wrap_t< T >, 3, Frame::NoFrame > | inv_jacobian (const std::array< T, 3 > &source_coords) const |
void | pup (PUP::er &p) |
bool | is_identity () const |
Static Public Attributes | |
static constexpr size_t | dim = 3 |
Friends | |
bool | operator== (const Rotation< 3 > &lhs, const Rotation< 3 > &rhs) |
Spatial rotation in three dimensions using Euler angles.
Rotation angles should be specified in degrees. First rotation \(\alpha\) is about z axis. Second rotation \(\beta\) is about rotated y axis. Third rotation \(\gamma\) is about rotated z axis. These rotations are of the \((\xi,\eta,\zeta)\) coordinate system with respect to the grid coordinates \((x,y,z)\).
The formula for the mapping is:
\begin{eqnarray*} x &=& \xi (\cos\gamma \cos\beta \cos\alpha - \sin\gamma \sin\alpha) + \eta (-\sin\gamma \cos\beta \cos\alpha - \cos\gamma \sin\alpha) + \zeta \sin\beta \cos\alpha \\ y &=& \xi (\cos\gamma \cos\beta \sin\alpha + \sin\gamma \cos\alpha) + \eta (-\sin\gamma \cos\beta \sin\alpha + \cos\gamma \cos\alpha) + \zeta \sin\beta \sin\alpha \\ z &=& -\xi \cos\gamma \sin\beta + \eta \sin\gamma \sin\beta + \zeta \cos\beta \end{eqnarray*}
domain::CoordinateMaps::Rotation< 3 >::Rotation | ( | double | rotation_about_z, |
double | rotation_about_rotated_y, | ||
double | rotation_about_rotated_z | ||
) |
Constructor.
rotation_about_z | the angle \(\alpha\) (in radians). |
rotation_about_rotated_y | the angle \(\beta\) (in radians). |
rotation_about_rotated_z | the angle \(\gamma\) (in radians). |