CLHEP/Vector/RotationX.h
// -*- C++ -*-
// CLASSDOC OFF
// ---------------------------------------------------------------------------
// CLASSDOC ON
//
// This file is a part of the CLHEP - a Class Library for High Energy Physics.
//
// This is the definition of the HepRotationX class for performing rotations
// around the X axis on objects of the Hep3Vector (and HepLorentzVector) class.
//
// HepRotationX is a concrete implementation of Hep3RotationInterface.
//
// .SS See Also
// RotationInterfaces.h
// ThreeVector.h, LorentzVector.h, LorentzRotation.h
//
// .SS Author
// Mark Fischler
#ifndef HEP_ROTATIONX_H
#define HEP_ROTATIONX_H
#ifdef GNUPRAGMA
#pragma interface
#endif
#include "CLHEP/Vector/RotationInterfaces.h"
#ifdef HEP_NO_INLINE_IN_DECLARATION
#define inline
#endif
class HepRotation;
class HepRotationX : public Hep3RotationInterface {
public:
// ---------- Constructors and Assignment:
inline HepRotationX();
// Default constructor. Gives an identity rotation.
HepRotationX(HepDouble delta);
// supply angle of rotation
inline HepRotationX(const HepRotationX & orig);
// Copy constructor.
inline HepRotationX & operator = (const HepRotationX & r);
// Assignment from a Rotation, which must be RotationX
HepRotationX & set ( HepDouble delta );
// set angle of rotation
inline ~HepRotationX();
// Trivial destructor.
// ---------- Accessors:
inline Hep3Vector colX() const;
inline Hep3Vector colY() const;
inline Hep3Vector colZ() const;
// orthogonal unit-length column vectors
inline Hep3Vector rowX() const;
inline Hep3Vector rowY() const;
inline Hep3Vector rowZ() const;
// orthogonal unit-length row vectors
inline HepDouble xx() const;
inline HepDouble xy() const;
inline HepDouble xz() const;
inline HepDouble yx() const;
inline HepDouble yy() const;
inline HepDouble yz() const;
inline HepDouble zx() const;
inline HepDouble zy() const;
inline HepDouble zz() const;
// Elements of the rotation matrix (Geant4).
virtual HepRep3x3 rep3x3() const;
// 3x3 representation:
// ------------ Euler angles:
inline HepDouble getPhi () const;
inline HepDouble getTheta() const;
inline HepDouble getPsi () const;
virtual HepDouble phi () const;
virtual HepDouble theta() const;
virtual HepDouble psi () const;
virtual HepEulerAngles eulerAngles() const;
// ------------ axis & angle of rotation:
inline HepDouble getDelta() const;
inline Hep3Vector getAxis () const;
inline HepDouble delta() const;
inline Hep3Vector axis () const;
inline HepAxisAngle axisAngle() const;
inline void getAngleAxis(HepDouble & delta, Hep3Vector & axis) const;
// Returns the rotation angle and rotation axis (Geant4).
// ------------- Angles of rotated axes
HepDouble phiX() const;
HepDouble phiY() const;
HepDouble phiZ() const;
HepDouble thetaX() const;
HepDouble thetaY() const;
HepDouble thetaZ() const;
// Return angles (RADS) made by rotated axes against original axes (Geant4).
// ---------- Other accessors treating pure rotation as a 4-rotation
// are inherited from Hep3RotationInterface
// --------- Mutators
virtual void setDelta (HepDouble delta);
// change angle of rotation, leaving rotation axis unchanged.
// ---------- Decomposition:
virtual void decompose (HepAxisAngle & rotation, Hep3Vector & boost) const;
virtual void decompose (Hep3Vector & boost, HepAxisAngle & rotation) const;
// These are trivial, as the boost vector is 0.
// ---------- Comparisons:
HepBoolean operator == (const HepRotationX &) const;
HepBoolean operator == (const Hep3RotationInterface &) const;
HepBoolean operator == (const Hep4RotationInterface &) const;
inline HepBoolean operator != (const HepRotationX &) const;
inline HepBoolean operator != (const Hep3RotationInterface &) const;
inline HepBoolean operator != (const Hep4RotationInterface &) const;
// Comparisons (Geant4).
inline HepBoolean isIdentity() const;
// Returns true if the identity matrix (Geant4).
// Dictionary-order comparisons inherited from Hep3RotationInterface.
virtual HepDouble distance2( const Hep4RotationInterface & lt ) const;
// 3 - Tr ( this/r ) + |b|^2 / (1-|b|^2) where b is the boost vector of lt
virtual HepDouble distance2( const HepRotationX & r ) const;
virtual HepDouble distance2( const Hep3RotationInterface & r ) const;
// 3 - Tr ( this/r )
virtual HepDouble howNear( const Hep4RotationInterface & lt ) const;
virtual HepDouble howNear( const Hep3RotationInterface & r ) const;
virtual HepDouble howNear( const HepRotationX & r ) const;
virtual HepBoolean isNear( const Hep4RotationInterface & lt,
HepDouble epsilon=tolerance) const;
virtual HepBoolean isNear( const Hep3RotationInterface & r,
HepDouble epsilon=tolerance) const;
virtual HepBoolean isNear( const HepRotationX & r,
HepDouble epsilon=tolerance) const;
// ---------- Properties:
virtual HepDouble norm2() const;
// distance2 (IDENTITY), which is 3 - Tr ( *this )
inline void rectify();
// non-const but logically moot correction for accumulated roundoff errors
// ---------- Application:
virtual Hep3Vector operator() (const Hep3Vector & p) const;
// Rotate a Hep3Vector.
inline Hep3Vector operator * (const Hep3Vector & p) const;
// Multiplication with a Hep3Vector.
virtual HepLorentzVector operator()( const HepLorentzVector & w ) const;
// Rotate (the space part of) a HepLorentzVector.
inline HepLorentzVector operator* ( const HepLorentzVector & w ) const;
// Multiplication with a HepLorentzVector.
// ---------- Operations in the group of Rotations
virtual HepRotation operator * (const Hep3RotationInterface & r) const;
// Product of two rotations (this) * r - matrix multiplication
virtual HepRotationX operator * (const HepRotationX & rx) const;
// Product of two X rotations: (this) * rx is known to be RotationX.
inline HepRotationX & operator *= (const HepRotationX & r);
inline HepRotationX & transform (const HepRotationX & r);
// Matrix multiplication.
// Note a *= b; <=> a = a * b; while a.transform(b); <=> a = b * a;
// However, in this special case, they commute: Both just add deltas.
inline HepRotationX inverse() const;
// Returns the inverse.
inline HepRotationX & invert();
// Inverts the Rotation matrix (be negating delta).
// ---------- I/O:
virtual HepStd::ostream & print( HepStd::ostream & os ) const;
// Output, identifying type of rotation and delta.
protected:
HepDouble d;
// The angle of rotation.
HepDouble s;
HepDouble c;
// Cache the trig functions, for rapid operations.
inline HepRotationX ( HepDouble dd, HepDouble ss, HepDouble cc );
// Unchecked load-the-data-members
};
// ---------- Free-function operations in the group of Rotations
inline HepRotationX inverseOf(const HepRotationX & r);
// Returns the inverse of a RotationX.
#ifdef HEP_NO_INLINE_IN_DECLARATION
#undef inline
#endif
#ifndef HEP_DEBUG_INLINE
#include "CLHEP/Vector/RotationX.icc"
#endif
#endif /* HEP_ROTATIONX_H */
Generated by GNU enscript 1.6.1.