#include "Math/GenVector/RotationZYX.h"
#include <cmath>
#include "Math/GenVector/Cartesian3D.h"
#include "Math/GenVector/DisplacementVector3D.h"
#include "Math/GenVector/RotationZYX.h"
#include "Math/GenVector/Rotation3D.h"
#include "Math/GenVector/Quaternion.h"
#include "Math/GenVector/RotationX.h"
#include "Math/GenVector/RotationY.h"
#include "Math/GenVector/RotationZ.h"
#include "Math/GenVector/AxisAnglefwd.h"
namespace ROOT {
namespace Math {
RotationZYX RotationZYX::operator * (const Rotation3D & r) const {
return RotationZYX ( Rotation3D(*this) * r );
}
RotationZYX RotationZYX::operator * (const AxisAngle & a) const {
return RotationZYX ( Quaternion(*this) * Quaternion(a) );
}
RotationZYX RotationZYX::operator * (const EulerAngles & e) const {
return RotationZYX ( Quaternion(*this) * Quaternion(e) );
}
RotationZYX RotationZYX::operator * (const RotationZYX & e) const {
return RotationZYX ( Rotation3D(*this) * Rotation3D(e) );
}
RotationZYX RotationZYX::operator * (const Quaternion & q) const {
return RotationZYX ( Quaternion(*this) * q );
}
RotationZYX RotationZYX::operator * (const RotationX & r) const {
return RotationZYX ( Quaternion(*this) * r );
}
RotationZYX RotationZYX::operator * (const RotationY & r) const {
return RotationZYX ( Quaternion(*this) * r );
}
RotationZYX RotationZYX::operator * (const RotationZ & r) const {
Scalar newPhi = fPhi + r.Angle();
if ( newPhi <= -Pi()|| newPhi > Pi() ) {
newPhi = newPhi - std::floor( newPhi/(2*Pi()) +.5 ) * 2*Pi();
}
return RotationZYX ( newPhi, fTheta, fPsi );
}
RotationZYX operator * ( RotationX const & r, RotationZYX const & e ) {
return RotationZYX(r) * e;
}
RotationZYX operator * ( RotationY const & r, RotationZYX const & e ) {
return RotationZYX(r) * e;
}
RotationZYX
operator * ( RotationZ const & r, RotationZYX const & e ) {
return RotationZYX(r) * e;
}
void RotationZYX::Rectify()
{
Scalar theta2 = fTheta + M_PI_2;
if ( theta2 < 0 || theta2 > Pi() ) {
Scalar t = theta2 - std::floor( theta2/(2*Pi() ) ) * 2*Pi();
if ( t <= Pi() ) {
theta2 = t;
} else {
theta2 = 2*Pi() - t;
fPhi = fPhi + Pi();
fPsi = fPsi + Pi();
}
fTheta = theta2 - M_PI_2;
}
if ( fPhi <= -Pi()|| fPhi > Pi() ) {
fPhi = fPhi - std::floor( fPhi/(2*Pi()) +.5 ) * 2*Pi();
}
if ( fPsi <= -Pi()|| fPsi > Pi() ) {
fPsi = fPsi - std::floor( fPsi/(2*Pi()) +.5 ) * 2*Pi();
}
}
void RotationZYX::Invert()
{
Rotation3D r(*this);
r.Invert();
*this = r;
}
std::ostream & operator<< (std::ostream & os, const RotationZYX & e) {
os << "\n{phi(Z angle): " << e.Phi() << " theta(Y angle): " << e.Theta()
<< " psi(X angle): " << e.Psi() << "}\n";
return os;
}
}
}
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.