SpECTRE
v2025.01.30
|
Spatial rotation in two dimensions. More...
#include <Rotation.hpp>
Public Member Functions | |
Rotation (double rotation_angle) | |
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 >, 2 > | operator() (const std::array< T, 2 > &source_coords) const |
std::optional< std::array< double, 2 > > | inverse (const std::array< double, 2 > &target_coords) const |
The inverse function is only callable with doubles because the inverse might fail if called for a point out of range, and it is unclear what should happen if the inverse were to succeed for some points in a DataVector but fail for other points. | |
template<typename T > | |
tnsr::Ij< tt::remove_cvref_wrap_t< T >, 2, Frame::NoFrame > | jacobian (const std::array< T, 2 > &source_coords) const |
template<typename T > | |
tnsr::Ij< tt::remove_cvref_wrap_t< T >, 2, Frame::NoFrame > | inv_jacobian (const std::array< T, 2 > &source_coords) const |
void | pup (PUP::er &p) |
bool | is_identity () const |
Static Public Attributes | |
static constexpr size_t | dim = 2 |
Friends | |
bool | operator== (const Rotation< 2 > &lhs, const Rotation< 2 > &rhs) |
Spatial rotation in two dimensions.
Let \((R,\Phi)\) be the polar coordinates associated with \((\xi,\eta)\). Let \((r,\phi)\) be the polar coordinates associated with \((x,y)\). Applies the spatial rotation \(\phi = \Phi + \alpha\).
The formula for the mapping is:
\begin{eqnarray*} x &=& \xi \cos \alpha - \eta \sin \alpha \\ y &=& \xi \sin \alpha + \eta \cos \alpha \end{eqnarray*}
.
|
explicit |
Constructor.
rotation_angle | the angle \(\alpha\) (in radians). |