BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Rotation matrix in three dimensions. Represents group SO(3). Internal parameterization based on quaternions.
Definition at line 25 of file RotMatrix.h.
Public Member Functions | |
RotMatrix () | |
Constructs unit transformation. More... | |
~RotMatrix ()=default | |
Destructor. More... | |
std::optional< double > | angleAroundCoordAxis (int iAxis) const |
template<class T > | |
T | counterTransformed (const T &v) const |
Return transformed vector v. More... | |
RotMatrix | Inverse () const |
Returns the inverse transformation. More... | |
bool | isIdentity () const |
Determine if the transformation is trivial (identity) More... | |
bool | isXRotation () const |
bool | isYRotation () const |
bool | isZRotation () const |
RotMatrix | operator* (const RotMatrix &) const |
Composes two transformations. More... | |
bool | operator== (const RotMatrix &) const |
Provides equality operator. More... | |
template<class T > | |
T | transformed (const T &v) const |
Return transformed vector v. More... | |
std::array< double, 3 > | zxzEulerAngles () const |
Calculates the Euler angles corresponding to the rotation. More... | |
Static Public Member Functions | |
static RotMatrix | AroundX (double phi) |
Creates rotation around x-axis. More... | |
static RotMatrix | AroundY (double phi) |
Creates rotation around y-axis. More... | |
static RotMatrix | AroundZ (double phi) |
Creates rotation around z-axis. More... | |
static RotMatrix | EulerZXZ (double alpha, double beta, double gamma) |
Creates rotation defined by Euler angles. More... | |
Private Member Functions | |
RotMatrix (double x_, double y_, double z_, double s_) | |
Private Attributes | |
double | s |
double | x |
double | y |
double | z |
RotMatrix::RotMatrix | ( | ) |
|
default |
Destructor.
|
private |
Definition at line 17 of file RotMatrix.cpp.
std::optional< double > RotMatrix::angleAroundCoordAxis | ( | int | iAxis | ) | const |
Definition at line 131 of file RotMatrix.cpp.
References isXRotation(), isYRotation(), isZRotation(), s, x, y, and z.
Referenced by IRotation::createRotation().
|
static |
Creates rotation around x-axis.
Definition at line 30 of file RotMatrix.cpp.
Referenced by EulerZXZ(), and RotationX::rotMatrix().
|
static |
Creates rotation around y-axis.
Definition at line 35 of file RotMatrix.cpp.
Referenced by RotationY::rotMatrix().
|
static |
Creates rotation around z-axis.
Definition at line 40 of file RotMatrix.cpp.
Referenced by EulerZXZ(), and RotationZ::rotMatrix().
template C3 RotMatrix::counterTransformed< C3 > | ( | const T & | v | ) | const |
Return transformed vector v.
Definition at line 92 of file RotMatrix.cpp.
References Inverse(), and transformed().
|
static |
Creates rotation defined by Euler angles.
Definition at line 45 of file RotMatrix.cpp.
References AroundX(), AroundZ(), ROOT::Math::Cephes::beta(), and ROOT::Math::Cephes::gamma().
Referenced by RotationEuler::rotMatrix().
RotMatrix RotMatrix::Inverse | ( | ) | const |
bool RotMatrix::isIdentity | ( | ) | const |
Determine if the transformation is trivial (identity)
Definition at line 111 of file RotMatrix.cpp.
Referenced by IRotation::createRotation(), and IRotation::isIdentity().
bool RotMatrix::isXRotation | ( | ) | const |
Definition at line 116 of file RotMatrix.cpp.
Referenced by angleAroundCoordAxis().
bool RotMatrix::isYRotation | ( | ) | const |
Definition at line 121 of file RotMatrix.cpp.
Referenced by angleAroundCoordAxis().
bool RotMatrix::isZRotation | ( | ) | const |
Definition at line 126 of file RotMatrix.cpp.
Referenced by angleAroundCoordAxis(), and IRotation::zInvariant().
bool RotMatrix::operator== | ( | const RotMatrix & | o | ) | const |
template C3 RotMatrix::transformed< C3 > | ( | const T & | v | ) | const |
Return transformed vector v.
Definition at line 76 of file RotMatrix.cpp.
Referenced by counterTransformed(), Lattice3D::rotated(), MagneticMaterialImpl::rotatedMaterial(), IRotation::transformed(), and WavevectorInfo::transformed().
std::array< double, 3 > RotMatrix::zxzEulerAngles | ( | ) | const |
Calculates the Euler angles corresponding to the rotation.
Definition at line 53 of file RotMatrix.cpp.
References ROOT::Math::Cephes::beta(), s, x, y, and z.
Referenced by IRotation::createRotation().
|
private |
Definition at line 77 of file RotMatrix.h.
Referenced by angleAroundCoordAxis(), Inverse(), operator*(), operator==(), transformed(), and zxzEulerAngles().
|
private |
Definition at line 77 of file RotMatrix.h.
Referenced by angleAroundCoordAxis(), Inverse(), isIdentity(), isYRotation(), isZRotation(), operator*(), operator==(), transformed(), and zxzEulerAngles().
|
private |
Definition at line 77 of file RotMatrix.h.
Referenced by angleAroundCoordAxis(), Inverse(), isIdentity(), isXRotation(), isZRotation(), operator*(), operator==(), transformed(), and zxzEulerAngles().
|
private |
Definition at line 77 of file RotMatrix.h.
Referenced by angleAroundCoordAxis(), Inverse(), isIdentity(), isXRotation(), isYRotation(), operator*(), operator==(), transformed(), and zxzEulerAngles().