class ROOT::Math::Rotation3D

```
Rotation class with the (3D) rotation represented by
a 3x3 orthogonal matrix.
This is the optimal representation for application to vectors.
classes which have conversion operators to Rotation3D.

All Rotations types (not only Rotation3D) can be applied to all 3D Vector classes
(like ROOT::Math::DisplacementVector3D and ROOT::Math::PositionVector3D)
and also to the 4D Vectors (ROOT::Math::LorentzVector classes), acting on the 3D components.
A rotaiton operation is applied by using the operator() or the operator *.
With the operator * is possible also to combine rotations.
Note that the operator is NOT commutative, the order how the rotations are applied is relevant.

@ingroup GenVector

```

Function Members (Methods)

public:
 ~Rotation3D() void GetComponents(double* begin) const void GetComponents(double* begin, double* end) const void GetComponents(ROOT::Math::Rotation3D::Scalar& xx, ROOT::Math::Rotation3D::Scalar& xy, ROOT::Math::Rotation3D::Scalar& xz, ROOT::Math::Rotation3D::Scalar& yx, ROOT::Math::Rotation3D::Scalar& yy, ROOT::Math::Rotation3D::Scalar& yz, ROOT::Math::Rotation3D::Scalar& zx, ROOT::Math::Rotation3D::Scalar& zy, ROOT::Math::Rotation3D::Scalar& zz) const ROOT::Math::Rotation3D Inverse() const void Invert() bool operator!=(const ROOT::Math::Rotation3D& rhs) const ROOT::Math::Rotation3D operator*(const ROOT::Math::Rotation3D& r) const ROOT::Math::Rotation3D operator*(const ROOT::Math::AxisAngle& a) const ROOT::Math::Rotation3D operator*(const ROOT::Math::EulerAngles& e) const ROOT::Math::Rotation3D operator*(const ROOT::Math::Quaternion& q) const ROOT::Math::Rotation3D operator*(const ROOT::Math::RotationZYX& r) const ROOT::Math::Rotation3D operator*(const ROOT::Math::RotationX& rx) const ROOT::Math::Rotation3D operator*(const ROOT::Math::RotationY& ry) const ROOT::Math::Rotation3D operator*(const ROOT::Math::RotationZ& rz) const ROOT::Math::PositionVector3D,ROOT::Math::DefaultCoordinateSystemTag> operator*(const ROOT::Math::PositionVector3D,ROOT::Math::DefaultCoordinateSystemTag>& v) const ROOT::Math::DisplacementVector3D,ROOT::Math::DefaultCoordinateSystemTag> operator*(const ROOT::Math::DisplacementVector3D,ROOT::Math::DefaultCoordinateSystemTag>& v) const ROOT::Math::LorentzVector > operator*(const ROOT::Math::LorentzVector >& v) const ROOT::Math::Rotation3D& operator=(ROOT::Math::Rotation3D const& rhs) ROOT::Math::Rotation3D& operator=(ROOT::Math::AxisAngle const& a) ROOT::Math::Rotation3D& operator=(ROOT::Math::EulerAngles const& e) ROOT::Math::Rotation3D& operator=(ROOT::Math::RotationZYX const& r) ROOT::Math::Rotation3D& operator=(ROOT::Math::Quaternion const& q) ROOT::Math::Rotation3D& operator=(ROOT::Math::RotationZ const& r) ROOT::Math::Rotation3D& operator=(ROOT::Math::RotationY const& r) ROOT::Math::Rotation3D& operator=(ROOT::Math::RotationX const& r) bool operator==(const ROOT::Math::Rotation3D& rhs) const void Rectify() ROOT::Math::Rotation3D Rotation3D() ROOT::Math::Rotation3D Rotation3D(ROOT::Math::Rotation3D const& r) ROOT::Math::Rotation3D Rotation3D(ROOT::Math::AxisAngle const& a) ROOT::Math::Rotation3D Rotation3D(ROOT::Math::EulerAngles const& e) ROOT::Math::Rotation3D Rotation3D(ROOT::Math::RotationZYX const& e) ROOT::Math::Rotation3D Rotation3D(ROOT::Math::Quaternion const& q) ROOT::Math::Rotation3D Rotation3D(ROOT::Math::RotationZ const& r) ROOT::Math::Rotation3D Rotation3D(ROOT::Math::RotationY const& r) ROOT::Math::Rotation3D Rotation3D(ROOT::Math::RotationX const& r) ROOT::Math::Rotation3D Rotation3D(double* begin, double* end) ROOT::Math::Rotation3D Rotation3D(const ROOT::Math::DisplacementVector3D,ROOT::Math::DefaultCoordinateSystemTag>& v1, const ROOT::Math::DisplacementVector3D,ROOT::Math::DefaultCoordinateSystemTag>& v2, const ROOT::Math::DisplacementVector3D,ROOT::Math::DefaultCoordinateSystemTag>& v3) ROOT::Math::Rotation3D Rotation3D(ROOT::Math::Rotation3D::Scalar xx, ROOT::Math::Rotation3D::Scalar xy, ROOT::Math::Rotation3D::Scalar xz, ROOT::Math::Rotation3D::Scalar yx, ROOT::Math::Rotation3D::Scalar yy, ROOT::Math::Rotation3D::Scalar yz, ROOT::Math::Rotation3D::Scalar zx, ROOT::Math::Rotation3D::Scalar zy, ROOT::Math::Rotation3D::Scalar zz) void SetComponents(double* begin, double* end) void SetComponents(const ROOT::Math::DisplacementVector3D,ROOT::Math::DefaultCoordinateSystemTag>& v1, const ROOT::Math::DisplacementVector3D,ROOT::Math::DefaultCoordinateSystemTag>& v2, const ROOT::Math::DisplacementVector3D,ROOT::Math::DefaultCoordinateSystemTag>& v3) void SetComponents(ROOT::Math::Rotation3D::Scalar xx, ROOT::Math::Rotation3D::Scalar xy, ROOT::Math::Rotation3D::Scalar xz, ROOT::Math::Rotation3D::Scalar yx, ROOT::Math::Rotation3D::Scalar yy, ROOT::Math::Rotation3D::Scalar yz, ROOT::Math::Rotation3D::Scalar zx, ROOT::Math::Rotation3D::Scalar zy, ROOT::Math::Rotation3D::Scalar zz)

Data Members

public:
 enum ERotation3DMatrixIndex { kXX kXY kXZ kYX kYY kYZ kZX kZY kZZ };
private:
 ROOT::Math::Rotation3D::Scalar fM[9] 9 elements (3x3 matrix) representing the rotation

Function documentation

``` ========== Constructors and Assignment =====================

Default constructor (identity rotation)

```
Rotation3D(double* begin, double* end)
```      Construct given a pair of pointers or iterators defining the
beginning and end of an array of nine Scalars

```
`{ SetComponents(begin,end); }`
Rotation3D( Rotation3D const & r )
```      copy constructor

```
explicit Rotation3D( AxisAngle const & a )
```      Construct from an AxisAngle

```
`{ gv_detail::convert(a, *this); }`
explicit Rotation3D( EulerAngles const & e )
```      Construct from EulerAngles

```
`{ gv_detail::convert(e, *this); }`
explicit Rotation3D( RotationZYX const & e )
```      Construct from RotationZYX

```
`{ gv_detail::convert(e, *this); }`
explicit Rotation3D( Quaternion const & q )
```      Construct from a Quaternion

```
`{ gv_detail::convert(q, *this); }`
explicit Rotation3D( RotationZ const & r )
```      Construct from an axial rotation

```
`{ gv_detail::convert(r, *this); }`
explicit Rotation3D( RotationY const & r )
`{ gv_detail::convert(r, *this); }`
explicit Rotation3D( RotationX const & r )
`{ gv_detail::convert(r, *this); }`
explicit Rotation3D(const ForeignMatrix & m)
```      Construct from a linear algebra matrix of size at least 3x3,
which must support operator()(i,j) to obtain elements (0,0) thru (2,2).
Precondition:  The matrix is assumed to be orthonormal.  No checking

```
`{ SetComponents(m); }`

```      Construct from three orthonormal vectors (which must have methods
x(), y() and z()) which will be used as the columns of the rotation
matrix.  The orthonormality will be checked, and values adjusted
so that the result will always be a good rotation matrix.

```
SetComponents(ROOT::Math::Rotation3D::Scalar xx, ROOT::Math::Rotation3D::Scalar xy, ROOT::Math::Rotation3D::Scalar xz, ROOT::Math::Rotation3D::Scalar yx, ROOT::Math::Rotation3D::Scalar yy, ROOT::Math::Rotation3D::Scalar yz, ROOT::Math::Rotation3D::Scalar zx, ROOT::Math::Rotation3D::Scalar zy, ROOT::Math::Rotation3D::Scalar zz)
``` compiler generated destruuctor is ok

Raw constructor from nine Scalar components (without any checking)

```
operator=( Rotation3D const & rhs )
``` need to implement assignment operator to avoid using the templated one

Assignment operator

```
SetComponents(ROOT::Math::Rotation3D::Scalar xx, ROOT::Math::Rotation3D::Scalar xy, ROOT::Math::Rotation3D::Scalar xz, ROOT::Math::Rotation3D::Scalar yx, ROOT::Math::Rotation3D::Scalar yy, ROOT::Math::Rotation3D::Scalar yz, ROOT::Math::Rotation3D::Scalar zx, ROOT::Math::Rotation3D::Scalar zy, ROOT::Math::Rotation3D::Scalar zz)
operator=( AxisAngle const & a )
```      Assign from an AxisAngle

```
`{ return operator=(Rotation3D(a)); }`
operator=( EulerAngles const & e )
```      Assign from EulerAngles

```
`{ return operator=(Rotation3D(e)); }`
operator=( RotationZYX const & r )
```      Assign from RotationZYX

```
`{ return operator=(Rotation3D(r)); }`
operator=( Quaternion const & q )
```      Assign from a Quaternion

```
`{return operator=(Rotation3D(q)); }`
operator=( RotationZ const & r )
```      Assign from an axial rotation

```
`{ return operator=(Rotation3D(r)); }`
operator=( RotationY const & r )
`{ return operator=(Rotation3D(r)); }`
operator=( RotationX const & r )
`{ return operator=(Rotation3D(r)); }`
SetComponents(ROOT::Math::Rotation3D::Scalar xx, ROOT::Math::Rotation3D::Scalar xy, ROOT::Math::Rotation3D::Scalar xz, ROOT::Math::Rotation3D::Scalar yx, ROOT::Math::Rotation3D::Scalar yy, ROOT::Math::Rotation3D::Scalar yz, ROOT::Math::Rotation3D::Scalar zx, ROOT::Math::Rotation3D::Scalar zy, ROOT::Math::Rotation3D::Scalar zz)
void Rectify()
```      Re-adjust components to eliminate small deviations from perfect
orthonormality.

```
GetComponents( ForeignVector& v1, ForeignVector& v2, ForeignVector& v3 )
```      Get components into three vectors which will be the (orthonormal)
columns of the rotation matrix.  (The vector class must have a
constructor from 3 Scalars.)

```
void GetComponents(double* begin, double* end) const
```      Get the 9 matrix components into data specified by an iterator begin
and another to the end of the desired data (9 past start).

```
void GetComponents(double* begin) const
```      Get the 9 matrix components into data specified by an iterator begin

```
AVector operator*(const AVector & v)
```      Overload operator * for rotation on a vector

```
void Invert()
```      Invert a rotation in place

```
Rotation3D Inverse() const
```      Return inverse of  a rotation

```
`{ Rotation3D t(*this); t.Invert(); return t; }`
return ! operator==(rhs)
Rotation3D operator*(RotationX const & r1, Rotation3D const & r2)
```   Multiplication of an axial rotation by a Rotation3D

```
Rotation3D operator*(RotationY const & r1, Rotation3D const & r2)
Rotation3D operator*(RotationZ const & r1, Rotation3D const & r2)
Rotation3D operator*(RotationX const & r1, RotationY const & r2)
```   Multiplication of an axial rotation by another axial Rotation

```
Rotation3D operator*(RotationX const & r1, RotationZ const & r2)
Rotation3D operator*(RotationY const & r1, RotationX const & r2)
Rotation3D operator*(RotationY const & r1, RotationZ const & r2)
Rotation3D operator*(RotationZ const & r1, RotationX const & r2)
Rotation3D operator*(RotationZ const & r1, RotationY const & r2)