Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends
CLHEP::HepRotationX Class Reference

#include <RotationX.h>

Public Member Functions

 HepRotationX ()
 
 HepRotationX (double delta)
 
 HepRotationX (const HepRotationX &orig)
 
HepRotationXoperator= (const HepRotationX &r)
 
HepRotationXset (double delta)
 
 ~HepRotationX ()
 
Hep3Vector colX () const
 
Hep3Vector colY () const
 
Hep3Vector colZ () const
 
Hep3Vector rowX () const
 
Hep3Vector rowY () const
 
Hep3Vector rowZ () const
 
double xx () const
 
double xy () const
 
double xz () const
 
double yx () const
 
double yy () const
 
double yz () const
 
double zx () const
 
double zy () const
 
double zz () const
 
HepRep3x3 rep3x3 () const
 
double getPhi () const
 
double getTheta () const
 
double getPsi () const
 
double phi () const
 
double theta () const
 
double psi () const
 
HepEulerAngles eulerAngles () const
 
double getDelta () const
 
Hep3Vector getAxis () const
 
double delta () const
 
Hep3Vector axis () const
 
HepAxisAngle axisAngle () const
 
void getAngleAxis (double &delta, Hep3Vector &axis) const
 
double phiX () const
 
double phiY () const
 
double phiZ () const
 
double thetaX () const
 
double thetaY () const
 
double thetaZ () const
 
HepLorentzVector col1 () const
 
HepLorentzVector col2 () const
 
HepLorentzVector col3 () const
 
HepLorentzVector col4 () const
 
HepLorentzVector row1 () const
 
HepLorentzVector row2 () const
 
HepLorentzVector row3 () const
 
HepLorentzVector row4 () const
 
double xt () const
 
double yt () const
 
double zt () const
 
double tx () const
 
double ty () const
 
double tz () const
 
double tt () const
 
HepRep4x4 rep4x4 () const
 
void setDelta (double delta)
 
void decompose (HepAxisAngle &rotation, Hep3Vector &boost) const
 
void decompose (Hep3Vector &boost, HepAxisAngle &rotation) const
 
void decompose (HepRotation &rotation, HepBoost &boost) const
 
void decompose (HepBoost &boost, HepRotation &rotation) const
 
bool isIdentity () const
 
int compare (const HepRotationX &r) const
 
bool operator== (const HepRotationX &r) const
 
bool operator!= (const HepRotationX &r) const
 
bool operator< (const HepRotationX &r) const
 
bool operator> (const HepRotationX &r) const
 
bool operator<= (const HepRotationX &r) const
 
bool operator>= (const HepRotationX &r) const
 
double distance2 (const HepRotationX &r) const
 
double distance2 (const HepRotation &r) const
 
double howNear (const HepRotationX &r) const
 
double howNear (const HepRotation &r) const
 
bool isNear (const HepRotationX &r, double epsilon=Hep4RotationInterface::tolerance) const
 
bool isNear (const HepRotation &r, double epsilon=Hep4RotationInterface::tolerance) const
 
double distance2 (const HepBoost &lt) const
 
double distance2 (const HepLorentzRotation &lt) const
 
double howNear (const HepBoost &lt) const
 
double howNear (const HepLorentzRotation &lt) const
 
bool isNear (const HepBoost &lt, double epsilon=Hep4RotationInterface::tolerance) const
 
bool isNear (const HepLorentzRotation &lt, double epsilon=Hep4RotationInterface::tolerance) const
 
double norm2 () const
 
void rectify ()
 
Hep3Vector operator() (const Hep3Vector &p) const
 
Hep3Vector operator* (const Hep3Vector &p) const
 
HepLorentzVector operator() (const HepLorentzVector &w) const
 
HepLorentzVector operator* (const HepLorentzVector &w) const
 
HepRotationX operator* (const HepRotationX &rx) const
 
HepRotationXoperator*= (const HepRotationX &r)
 
HepRotationXtransform (const HepRotationX &r)
 
HepRotationX inverse () const
 
HepRotationXinvert ()
 
std::ostream & print (std::ostream &os) const
 

Static Public Member Functions

static double getTolerance ()
 
static double setTolerance (double tol)
 

Protected Member Functions

 HepRotationX (double dd, double ss, double cc)
 

Static Protected Member Functions

static double proper (double delta)
 

Protected Attributes

double its_d
 
double its_s
 
double its_c
 

Friends

HepRotationX inverseOf (const HepRotationX &r)
 

Detailed Description

Author

Definition at line 43 of file RotationX.h.

Constructor & Destructor Documentation

CLHEP::HepRotationX::HepRotationX ( )
inline
CLHEP::HepRotationX::HepRotationX ( double  delta)

Definition at line 31 of file RotationX.cc.

31  :
32  its_d(proper(ddelta)), its_s(std::sin(ddelta)), its_c(std::cos(ddelta))
33 {}
static double proper(double delta)
CLHEP::HepRotationX::HepRotationX ( const HepRotationX orig)
inline
CLHEP::HepRotationX::~HepRotationX ( )
inline
CLHEP::HepRotationX::HepRotationX ( double  dd,
double  ss,
double  cc 
)
inlineprotected

Member Function Documentation

Hep3Vector CLHEP::HepRotationX::axis ( ) const
inline
HepAxisAngle CLHEP::HepRotationX::axisAngle ( ) const
inline
HepLorentzVector CLHEP::HepRotationX::col1 ( ) const
inline
HepLorentzVector CLHEP::HepRotationX::col2 ( ) const
inline
HepLorentzVector CLHEP::HepRotationX::col3 ( ) const
inline
HepLorentzVector CLHEP::HepRotationX::col4 ( ) const
inline
Hep3Vector CLHEP::HepRotationX::colX ( ) const
inline
Hep3Vector CLHEP::HepRotationX::colY ( ) const
inline
Hep3Vector CLHEP::HepRotationX::colZ ( ) const
inline
int CLHEP::HepRotationX::compare ( const HepRotationX r) const
inline
void CLHEP::HepRotationX::decompose ( HepAxisAngle rotation,
Hep3Vector boost 
) const

Definition at line 108 of file RotationX.cc.

References CLHEP::Hep3Vector::set().

108  {
109  boost.set(0,0,0);
110  rotation = axisAngle();
111 }
HepAxisAngle axisAngle() const
void CLHEP::HepRotationX::decompose ( Hep3Vector boost,
HepAxisAngle rotation 
) const

Definition at line 114 of file RotationX.cc.

References CLHEP::Hep3Vector::set().

114  {
115  boost.set(0,0,0);
116  rotation = axisAngle();
117 }
HepAxisAngle axisAngle() const
void CLHEP::HepRotationX::decompose ( HepRotation rotation,
HepBoost boost 
) const

Definition at line 120 of file RotationX.cc.

References CLHEP::HepBoost::set().

120  {
121  boost.set(0,0,0);
122  rotation = HepRotation(*this);
123 }
void CLHEP::HepRotationX::decompose ( HepBoost boost,
HepRotation rotation 
) const

Definition at line 126 of file RotationX.cc.

References CLHEP::HepBoost::set().

126  {
127  boost.set(0,0,0);
128  rotation = HepRotation(*this);
129 }
double CLHEP::HepRotationX::delta ( ) const
inline
double CLHEP::HepRotationX::distance2 ( const HepRotationX r) const

Definition at line 131 of file RotationX.cc.

References its_c, and its_s.

Referenced by distance2(), howNear(), and isNear().

131  {
132  double answer = 2.0 * ( 1.0 - ( its_s * r.its_s + its_c * r.its_c ) ) ;
133  return (answer >= 0) ? answer : 0;
134 }
double CLHEP::HepRotationX::distance2 ( const HepRotation r) const

Definition at line 136 of file RotationX.cc.

References CLHEP::HepRotation::xx(), yy(), CLHEP::HepRotation::yy(), yz(), CLHEP::HepRotation::yz(), zy(), CLHEP::HepRotation::zy(), zz(), and CLHEP::HepRotation::zz().

136  {
137  double sum = r.xx() +
138  yy() * r.yy() + yz() * r.yz()
139  + zy() * r.zy() + zz() * r.zz();
140  double answer = 3.0 - sum;
141  return (answer >= 0 ) ? answer : 0;
142 }
double zy() const
double zz() const
double yz() const
double yy() const
double CLHEP::HepRotationX::distance2 ( const HepBoost lt) const

Definition at line 154 of file RotationX.cc.

References distance2().

154  {
155  return distance2( HepLorentzRotation(lt));
156 }
double distance2(const HepRotationX &r) const
Definition: RotationX.cc:131
double CLHEP::HepRotationX::distance2 ( const HepLorentzRotation lt) const

Definition at line 144 of file RotationX.cc.

References test::a, test::b, CLHEP::Hep3Vector::beta(), CLHEP::HepLorentzRotation::decompose(), and distance2().

144  {
145  HepAxisAngle a;
146  Hep3Vector b;
147  lt.decompose(b, a);
148  double bet = b.beta();
149  double bet2 = bet*bet;
150  HepRotation r(a);
151  return bet2/(1-bet2) + distance2(r);
152 }
double distance2(const HepRotationX &r) const
Definition: RotationX.cc:131
HepEulerAngles CLHEP::HepRotationX::eulerAngles ( ) const

Definition at line 62 of file RotationX.cc.

References phi(), psi(), and theta().

62  {
63  return HepEulerAngles( phi(), theta(), psi() );
64 } // HepRotationX::eulerAngles()
double theta() const
Definition: RotationX.cc:50
double phi() const
Definition: RotationX.cc:42
double psi() const
Definition: RotationX.cc:54
void CLHEP::HepRotationX::getAngleAxis ( double &  delta,
Hep3Vector axis 
) const
inline
Hep3Vector CLHEP::HepRotationX::getAxis ( ) const
inline
double CLHEP::HepRotationX::getDelta ( ) const
inline
double CLHEP::HepRotationX::getPhi ( ) const
inline
double CLHEP::HepRotationX::getPsi ( ) const
inline
double CLHEP::HepRotationX::getTheta ( ) const
inline
static double CLHEP::HepRotationX::getTolerance ( )
inlinestatic
double CLHEP::HepRotationX::howNear ( const HepRotationX r) const

Definition at line 158 of file RotationX.cc.

References distance2().

158  {
159  return std::sqrt(distance2(r));
160 }
double distance2(const HepRotationX &r) const
Definition: RotationX.cc:131
double CLHEP::HepRotationX::howNear ( const HepRotation r) const

Definition at line 161 of file RotationX.cc.

References distance2().

161  {
162  return std::sqrt(distance2(r));
163 }
double distance2(const HepRotationX &r) const
Definition: RotationX.cc:131
double CLHEP::HepRotationX::howNear ( const HepBoost lt) const

Definition at line 164 of file RotationX.cc.

References distance2().

164  {
165  return std::sqrt(distance2(b));
166 }
double distance2(const HepRotationX &r) const
Definition: RotationX.cc:131
double CLHEP::HepRotationX::howNear ( const HepLorentzRotation lt) const

Definition at line 167 of file RotationX.cc.

References distance2().

167  {
168  return std::sqrt(distance2(lt));
169 }
double distance2(const HepRotationX &r) const
Definition: RotationX.cc:131
HepRotationX CLHEP::HepRotationX::inverse ( ) const
inline
HepRotationX& CLHEP::HepRotationX::invert ( )
inline
bool CLHEP::HepRotationX::isIdentity ( ) const
inline
bool CLHEP::HepRotationX::isNear ( const HepRotationX r,
double  epsilon = Hep4RotationInterface::tolerance 
) const

Definition at line 170 of file RotationX.cc.

References distance2().

170  {
171  return (distance2(r) <= epsilon*epsilon);
172 }
double distance2(const HepRotationX &r) const
Definition: RotationX.cc:131
bool CLHEP::HepRotationX::isNear ( const HepRotation r,
double  epsilon = Hep4RotationInterface::tolerance 
) const

Definition at line 173 of file RotationX.cc.

References distance2().

173  {
174  return (distance2(r) <= epsilon*epsilon);
175 }
double distance2(const HepRotationX &r) const
Definition: RotationX.cc:131
bool CLHEP::HepRotationX::isNear ( const HepBoost lt,
double  epsilon = Hep4RotationInterface::tolerance 
) const

Definition at line 176 of file RotationX.cc.

References distance2().

176  {
177  return (distance2(lt) <= epsilon*epsilon);
178 }
double distance2(const HepRotationX &r) const
Definition: RotationX.cc:131
bool CLHEP::HepRotationX::isNear ( const HepLorentzRotation lt,
double  epsilon = Hep4RotationInterface::tolerance 
) const

Definition at line 180 of file RotationX.cc.

References distance2().

181  {
182  return (distance2(lt) <= epsilon*epsilon);
183 }
double distance2(const HepRotationX &r) const
Definition: RotationX.cc:131
double CLHEP::HepRotationX::norm2 ( ) const

Definition at line 185 of file RotationX.cc.

References its_c.

185  {
186  return 2.0 - 2.0 * its_c;
187 }
bool CLHEP::HepRotationX::operator!= ( const HepRotationX r) const
inline
Hep3Vector CLHEP::HepRotationX::operator() ( const Hep3Vector p) const
inline
HepLorentzVector CLHEP::HepRotationX::operator() ( const HepLorentzVector w) const
inline
Hep3Vector CLHEP::HepRotationX::operator* ( const Hep3Vector p) const
inline
HepLorentzVector CLHEP::HepRotationX::operator* ( const HepLorentzVector w) const
inline
HepRotationX CLHEP::HepRotationX::operator* ( const HepRotationX rx) const
inline
HepRotationX& CLHEP::HepRotationX::operator*= ( const HepRotationX r)
inline
bool CLHEP::HepRotationX::operator< ( const HepRotationX r) const
inline
bool CLHEP::HepRotationX::operator<= ( const HepRotationX r) const
inline
HepRotationX& CLHEP::HepRotationX::operator= ( const HepRotationX r)
inline
bool CLHEP::HepRotationX::operator== ( const HepRotationX r) const
inline
bool CLHEP::HepRotationX::operator> ( const HepRotationX r) const
inline
bool CLHEP::HepRotationX::operator>= ( const HepRotationX r) const
inline
double CLHEP::HepRotationX::phi ( ) const

Definition at line 42 of file RotationX.cc.

References its_d.

Referenced by eulerAngles().

42  {
43  if ( (its_d > 0) && (its_d < CLHEP::pi) ) {
44  return CLHEP::pi;
45  } else {
46  return 0.0;
47  }
48 } // HepRotationX::phi()
double CLHEP::HepRotationX::phiX ( ) const

Definition at line 74 of file RotationX.cc.

References xx(), and yx().

74  {
75  return (yx() == 0.0 && xx() == 0.0) ? 0.0 : std::atan2(yx(),xx());
76  // or ---- return 0;
77 }
double xx() const
double yx() const
double CLHEP::HepRotationX::phiY ( ) const

Definition at line 79 of file RotationX.cc.

References xy(), and yy().

79  {
80  return (yy() == 0.0 && xy() == 0.0) ? 0.0 : std::atan2(yy(),xy());
81  // or ---- return (yy() == 0.0) ? 0.0 : std::atan2(yy(),xy());
82 }
double yy() const
double xy() const
double CLHEP::HepRotationX::phiZ ( ) const

Definition at line 84 of file RotationX.cc.

References xz(), and yz().

84  {
85  return (yz() == 0.0 && xz() == 0.0) ? 0.0 : std::atan2(yz(),xz());
86  // or ---- return (yz() == 0.0) ? 0.0 : std::atan2(yz(),xz());
87 }
double yz() const
double xz() const
std::ostream & CLHEP::HepRotationX::print ( std::ostream &  os) const

Definition at line 189 of file RotationX.cc.

References its_c, its_d, and its_s.

189  {
190  os << "\nRotation about X (" << its_d <<
191  ") [cos d = " << its_c << " sin d = " << its_s << "]\n";
192  return os;
193 }
static double CLHEP::HepRotationX::proper ( double  delta)
inlinestaticprotected

Referenced by set().

double CLHEP::HepRotationX::psi ( ) const

Definition at line 54 of file RotationX.cc.

References its_d.

Referenced by eulerAngles().

54  {
55  if ( (its_d > 0) && (its_d < CLHEP::pi) ) {
56  return CLHEP::pi;
57  } else {
58  return 0.0;
59  }
60 } // HepRotationX::psi()
void CLHEP::HepRotationX::rectify ( )
inline
HepRep3x3 CLHEP::HepRotationX::rep3x3 ( ) const
inline
HepRep4x4 CLHEP::HepRotationX::rep4x4 ( ) const
inline
HepLorentzVector CLHEP::HepRotationX::row1 ( ) const
inline
HepLorentzVector CLHEP::HepRotationX::row2 ( ) const
inline
HepLorentzVector CLHEP::HepRotationX::row3 ( ) const
inline
HepLorentzVector CLHEP::HepRotationX::row4 ( ) const
inline
Hep3Vector CLHEP::HepRotationX::rowX ( ) const
inline
Hep3Vector CLHEP::HepRotationX::rowY ( ) const
inline
Hep3Vector CLHEP::HepRotationX::rowZ ( ) const
inline
HepRotationX & CLHEP::HepRotationX::set ( double  delta)

Definition at line 35 of file RotationX.cc.

References its_c, its_d, its_s, and proper().

Referenced by setDelta().

35  {
36  its_d = proper(ddelta);
37  its_s = std::sin(its_d);
38  its_c = std::cos(its_d);
39  return *this;
40 }
static double proper(double delta)
void CLHEP::HepRotationX::setDelta ( double  delta)

Definition at line 103 of file RotationX.cc.

References set().

103  {
104  set(ddelta);
105 }
HepRotationX & set(double delta)
Definition: RotationX.cc:35
static double CLHEP::HepRotationX::setTolerance ( double  tol)
inlinestatic
double CLHEP::HepRotationX::theta ( ) const

Definition at line 50 of file RotationX.cc.

References its_d.

Referenced by eulerAngles().

50  {
51  return std::fabs( its_d );
52 } // HepRotationX::theta()
double CLHEP::HepRotationX::thetaX ( ) const

Definition at line 89 of file RotationX.cc.

References zx().

89  {
90  return safe_acos(zx());
91  // or ---- return CLHEP::halfpi;
92 }
double zx() const
double CLHEP::HepRotationX::thetaY ( ) const

Definition at line 94 of file RotationX.cc.

References zy().

94  {
95  return safe_acos(zy());
96 }
double zy() const
double CLHEP::HepRotationX::thetaZ ( ) const

Definition at line 98 of file RotationX.cc.

References zz().

98  {
99  return safe_acos(zz());
100  // or ---- return d;
101 }
double zz() const
HepRotationX& CLHEP::HepRotationX::transform ( const HepRotationX r)
inline
double CLHEP::HepRotationX::tt ( ) const
inline
double CLHEP::HepRotationX::tx ( ) const
inline
double CLHEP::HepRotationX::ty ( ) const
inline
double CLHEP::HepRotationX::tz ( ) const
inline
double CLHEP::HepRotationX::xt ( ) const
inline
double CLHEP::HepRotationX::xx ( ) const
inline

Referenced by phiX().

double CLHEP::HepRotationX::xy ( ) const
inline

Referenced by phiY().

double CLHEP::HepRotationX::xz ( ) const
inline

Referenced by phiZ().

double CLHEP::HepRotationX::yt ( ) const
inline
double CLHEP::HepRotationX::yx ( ) const
inline

Referenced by phiX().

double CLHEP::HepRotationX::yy ( ) const
inline

Referenced by distance2(), and phiY().

double CLHEP::HepRotationX::yz ( ) const
inline

Referenced by distance2(), and phiZ().

double CLHEP::HepRotationX::zt ( ) const
inline
double CLHEP::HepRotationX::zx ( ) const
inline

Referenced by thetaX().

double CLHEP::HepRotationX::zy ( ) const
inline

Referenced by distance2(), and thetaY().

double CLHEP::HepRotationX::zz ( ) const
inline

Referenced by distance2(), and thetaZ().

Friends And Related Function Documentation

HepRotationX inverseOf ( const HepRotationX r)
friend

Field Documentation

double CLHEP::HepRotationX::its_c
protected

Definition at line 264 of file RotationX.h.

Referenced by distance2(), norm2(), print(), and set().

double CLHEP::HepRotationX::its_d
protected

Definition at line 260 of file RotationX.h.

Referenced by phi(), print(), psi(), set(), and theta().

double CLHEP::HepRotationX::its_s
protected

Definition at line 263 of file RotationX.h.

Referenced by distance2(), print(), and set().


The documentation for this class was generated from the following files: