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::HepRotationY Class Reference

#include <RotationY.h>

Public Member Functions

 HepRotationY ()
 
 HepRotationY (double delta)
 
 HepRotationY (const HepRotationY &orig)
 
HepRotationYoperator= (const HepRotationY &r)
 
HepRotationYset (double delta)
 
 ~HepRotationY ()
 
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 HepRotationY &r) const
 
bool operator== (const HepRotationY &r) const
 
bool operator!= (const HepRotationY &r) const
 
bool operator< (const HepRotationY &r) const
 
bool operator> (const HepRotationY &r) const
 
bool operator<= (const HepRotationY &r) const
 
bool operator>= (const HepRotationY &r) const
 
double distance2 (const HepRotationY &r) const
 
double distance2 (const HepRotation &r) const
 
double howNear (const HepRotationY &r) const
 
double howNear (const HepRotation &r) const
 
bool isNear (const HepRotationY &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
 
HepRotationY operator* (const HepRotationY &ry) const
 
HepRotationYoperator*= (const HepRotationY &r)
 
HepRotationYtransform (const HepRotationY &r)
 
HepRotationY inverse () const
 
HepRotationYinvert ()
 
std::ostream & print (std::ostream &os) const
 

Static Public Member Functions

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

Protected Member Functions

 HepRotationY (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

HepRotationY inverseOf (const HepRotationY &r)
 

Detailed Description

Author

Definition at line 42 of file RotationY.h.

Constructor & Destructor Documentation

CLHEP::HepRotationY::HepRotationY ( )
inline
CLHEP::HepRotationY::HepRotationY ( double  delta)

Definition at line 31 of file RotationY.cc.

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

Member Function Documentation

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

Definition at line 112 of file RotationY.cc.

References CLHEP::Hep3Vector::set().

112  {
113  boost.set(0,0,0);
114  rotation = axisAngle();
115 }
HepAxisAngle axisAngle() const
void CLHEP::HepRotationY::decompose ( Hep3Vector boost,
HepAxisAngle rotation 
) const

Definition at line 118 of file RotationY.cc.

References CLHEP::Hep3Vector::set().

118  {
119  boost.set(0,0,0);
120  rotation = axisAngle();
121 }
HepAxisAngle axisAngle() const
void CLHEP::HepRotationY::decompose ( HepRotation rotation,
HepBoost boost 
) const

Definition at line 124 of file RotationY.cc.

References CLHEP::HepBoost::set().

124  {
125  boost.set(0,0,0);
126  rotation = HepRotation(*this);
127 }
void CLHEP::HepRotationY::decompose ( HepBoost boost,
HepRotation rotation 
) const

Definition at line 130 of file RotationY.cc.

References CLHEP::HepBoost::set().

130  {
131  boost.set(0,0,0);
132  rotation = HepRotation(*this);
133 }
double CLHEP::HepRotationY::delta ( ) const
inline
double CLHEP::HepRotationY::distance2 ( const HepRotationY r) const

Definition at line 135 of file RotationY.cc.

References its_c, and its_s.

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

135  {
136  double answer = 2.0 * ( 1.0 - ( its_s * r.its_s + its_c * r.its_c ) ) ;
137  return (answer >= 0) ? answer : 0;
138 }
double CLHEP::HepRotationY::distance2 ( const HepRotation r) const

Definition at line 140 of file RotationY.cc.

References xx(), CLHEP::HepRotation::xx(), xz(), CLHEP::HepRotation::xz(), CLHEP::HepRotation::yy(), zx(), CLHEP::HepRotation::zx(), zz(), and CLHEP::HepRotation::zz().

140  {
141  double sum = xx() * r.xx() + xz() * r.xz()
142  + r.yy()
143  + zx() * r.zx() + zz() * r.zz();
144  double answer = 3.0 - sum;
145  return (answer >= 0 ) ? answer : 0;
146 }
double xx() const
double xz() const
double zx() const
double zz() const
double CLHEP::HepRotationY::distance2 ( const HepBoost lt) const

Definition at line 158 of file RotationY.cc.

References distance2().

158  {
159  return distance2( HepLorentzRotation(lt));
160 }
double distance2(const HepRotationY &r) const
Definition: RotationY.cc:135
double CLHEP::HepRotationY::distance2 ( const HepLorentzRotation lt) const

Definition at line 148 of file RotationY.cc.

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

148  {
149  HepAxisAngle a;
150  Hep3Vector b;
151  lt.decompose(b, a);
152  double bet = b.beta();
153  double bet2 = bet*bet;
154  HepRotation r(a);
155  return bet2/(1-bet2) + distance2(r);
156 }
double distance2(const HepRotationY &r) const
Definition: RotationY.cc:135
HepEulerAngles CLHEP::HepRotationY::eulerAngles ( ) const

Definition at line 66 of file RotationY.cc.

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

66  {
67  return HepEulerAngles( phi(), theta(), psi() );
68 } // HepRotationY::eulerAngles()
double phi() const
Definition: RotationY.cc:42
double psi() const
Definition: RotationY.cc:56
double theta() const
Definition: RotationY.cc:52
void CLHEP::HepRotationY::getAngleAxis ( double &  delta,
Hep3Vector axis 
) const
inline
Hep3Vector CLHEP::HepRotationY::getAxis ( ) const
inline
double CLHEP::HepRotationY::getDelta ( ) const
inline
double CLHEP::HepRotationY::getPhi ( ) const
inline
double CLHEP::HepRotationY::getPsi ( ) const
inline
double CLHEP::HepRotationY::getTheta ( ) const
inline
static double CLHEP::HepRotationY::getTolerance ( )
inlinestatic
double CLHEP::HepRotationY::howNear ( const HepRotationY r) const

Definition at line 162 of file RotationY.cc.

References distance2().

162  {
163  return std::sqrt(distance2(r));
164 }
double distance2(const HepRotationY &r) const
Definition: RotationY.cc:135
double CLHEP::HepRotationY::howNear ( const HepRotation r) const

Definition at line 165 of file RotationY.cc.

References distance2().

165  {
166  return std::sqrt(distance2(r));
167 }
double distance2(const HepRotationY &r) const
Definition: RotationY.cc:135
double CLHEP::HepRotationY::howNear ( const HepBoost lt) const

Definition at line 168 of file RotationY.cc.

References distance2().

168  {
169  return std::sqrt(distance2(lt));
170 }
double distance2(const HepRotationY &r) const
Definition: RotationY.cc:135
double CLHEP::HepRotationY::howNear ( const HepLorentzRotation lt) const

Definition at line 171 of file RotationY.cc.

References distance2().

171  {
172  return std::sqrt(distance2(lt));
173 }
double distance2(const HepRotationY &r) const
Definition: RotationY.cc:135
HepRotationY CLHEP::HepRotationY::inverse ( ) const
inline
HepRotationY& CLHEP::HepRotationY::invert ( )
inline
bool CLHEP::HepRotationY::isIdentity ( ) const
inline
bool CLHEP::HepRotationY::isNear ( const HepRotationY r,
double  epsilon = Hep4RotationInterface::tolerance 
) const

Definition at line 174 of file RotationY.cc.

References distance2().

174  {
175  return (distance2(r) <= epsilon*epsilon);
176 }
double distance2(const HepRotationY &r) const
Definition: RotationY.cc:135
bool CLHEP::HepRotationY::isNear ( const HepRotation r,
double  epsilon = Hep4RotationInterface::tolerance 
) const

Definition at line 177 of file RotationY.cc.

References distance2().

177  {
178  return (distance2(r) <= epsilon*epsilon);
179 }
double distance2(const HepRotationY &r) const
Definition: RotationY.cc:135
bool CLHEP::HepRotationY::isNear ( const HepBoost lt,
double  epsilon = Hep4RotationInterface::tolerance 
) const

Definition at line 180 of file RotationY.cc.

References distance2().

180  {
181  return (distance2(lt) <= epsilon*epsilon);
182 }
double distance2(const HepRotationY &r) const
Definition: RotationY.cc:135
bool CLHEP::HepRotationY::isNear ( const HepLorentzRotation lt,
double  epsilon = Hep4RotationInterface::tolerance 
) const

Definition at line 183 of file RotationY.cc.

References distance2().

184  {
185  return (distance2(lt) <= epsilon*epsilon);
186 }
double distance2(const HepRotationY &r) const
Definition: RotationY.cc:135
double CLHEP::HepRotationY::norm2 ( ) const

Definition at line 188 of file RotationY.cc.

References its_c.

188  {
189  return 2.0 - 2.0 * its_c;
190 }
bool CLHEP::HepRotationY::operator!= ( const HepRotationY r) const
inline
Hep3Vector CLHEP::HepRotationY::operator() ( const Hep3Vector p) const
inline
HepLorentzVector CLHEP::HepRotationY::operator() ( const HepLorentzVector w) const
inline
Hep3Vector CLHEP::HepRotationY::operator* ( const Hep3Vector p) const
inline
HepLorentzVector CLHEP::HepRotationY::operator* ( const HepLorentzVector w) const
inline
HepRotationY CLHEP::HepRotationY::operator* ( const HepRotationY ry) const
inline
HepRotationY& CLHEP::HepRotationY::operator*= ( const HepRotationY r)
inline
bool CLHEP::HepRotationY::operator< ( const HepRotationY r) const
inline
bool CLHEP::HepRotationY::operator<= ( const HepRotationY r) const
inline
HepRotationY& CLHEP::HepRotationY::operator= ( const HepRotationY r)
inline
bool CLHEP::HepRotationY::operator== ( const HepRotationY r) const
inline
bool CLHEP::HepRotationY::operator> ( const HepRotationY r) const
inline
bool CLHEP::HepRotationY::operator>= ( const HepRotationY r) const
inline
double CLHEP::HepRotationY::phi ( ) const

Definition at line 42 of file RotationY.cc.

References its_d.

Referenced by eulerAngles().

42  {
43  if ( its_d == 0 ) {
44  return 0;
45  } else if ( (its_d < 0) || (its_d == CLHEP::pi) ) {
46  return +CLHEP::halfpi;
47  } else {
48  return -CLHEP::halfpi;
49  }
50 } // HepRotationY::phi()
double CLHEP::HepRotationY::phiX ( ) const

Definition at line 78 of file RotationY.cc.

References xx(), and yx().

78  {
79  return (yx() == 0.0 && xx() == 0.0) ? 0.0 : std::atan2(yx(),xx());
80  // or ---- return 0;
81 }
double xx() const
double yx() const
double CLHEP::HepRotationY::phiY ( ) const

Definition at line 83 of file RotationY.cc.

References xy(), and yy().

83  {
84  return (yy() == 0.0 && xy() == 0.0) ? 0.0 : std::atan2(yy(),xy());
85  // or ---- return CLHEP::halfpi;
86 }
double xy() const
double yy() const
double CLHEP::HepRotationY::phiZ ( ) const

Definition at line 88 of file RotationY.cc.

References xz(), and yz().

88  {
89  return (yz() == 0.0 && xz() == 0.0) ? 0.0 : std::atan2(yz(),xz());
90  // or ---- return 0;
91 }
double xz() const
double yz() const
std::ostream & CLHEP::HepRotationY::print ( std::ostream &  os) const

Definition at line 192 of file RotationY.cc.

References its_c, its_d, and its_s.

192  {
193  os << "\nRotation about Y (" << its_d <<
194  ") [cos d = " << its_c << " sin d = " << its_s << "]\n";
195  return os;
196 }
static double CLHEP::HepRotationY::proper ( double  delta)
inlinestaticprotected

Referenced by set().

double CLHEP::HepRotationY::psi ( ) const

Definition at line 56 of file RotationY.cc.

References its_d.

Referenced by eulerAngles().

56  {
57  if ( its_d == 0 ) {
58  return 0;
59  } else if ( (its_d < 0) || (its_d == CLHEP::pi) ) {
60  return -CLHEP::halfpi;
61  } else {
62  return +CLHEP::halfpi;
63  }
64 } // HepRotationY::psi()
void CLHEP::HepRotationY::rectify ( )
inline
HepRep3x3 CLHEP::HepRotationY::rep3x3 ( ) const
inline
HepRep4x4 CLHEP::HepRotationY::rep4x4 ( ) const
inline
HepLorentzVector CLHEP::HepRotationY::row1 ( ) const
inline
HepLorentzVector CLHEP::HepRotationY::row2 ( ) const
inline
HepLorentzVector CLHEP::HepRotationY::row3 ( ) const
inline
HepLorentzVector CLHEP::HepRotationY::row4 ( ) const
inline
Hep3Vector CLHEP::HepRotationY::rowX ( ) const
inline
Hep3Vector CLHEP::HepRotationY::rowY ( ) const
inline
Hep3Vector CLHEP::HepRotationY::rowZ ( ) const
inline
HepRotationY & CLHEP::HepRotationY::set ( double  delta)

Definition at line 35 of file RotationY.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::HepRotationY::setDelta ( double  delta)

Definition at line 107 of file RotationY.cc.

References set().

107  {
108  set(ddelta);
109 }
HepRotationY & set(double delta)
Definition: RotationY.cc:35
static double CLHEP::HepRotationY::setTolerance ( double  tol)
inlinestatic
double CLHEP::HepRotationY::theta ( ) const

Definition at line 52 of file RotationY.cc.

References its_d.

Referenced by eulerAngles().

52  {
53  return std::fabs( its_d );
54 } // HepRotationY::theta()
double CLHEP::HepRotationY::thetaX ( ) const

Definition at line 93 of file RotationY.cc.

References zx().

93  {
94  return safe_acos(zx());
95 }
double zx() const
double CLHEP::HepRotationY::thetaY ( ) const

Definition at line 97 of file RotationY.cc.

References zy().

97  {
98  return safe_acos(zy());
99  // or ---- return CLHEP::halfpi;
100 }
double zy() const
double CLHEP::HepRotationY::thetaZ ( ) const

Definition at line 102 of file RotationY.cc.

References zz().

102  {
103  return safe_acos(zz());
104  // or ---- return d;
105 }
double zz() const
HepRotationY& CLHEP::HepRotationY::transform ( const HepRotationY r)
inline
double CLHEP::HepRotationY::tt ( ) const
inline
double CLHEP::HepRotationY::tx ( ) const
inline
double CLHEP::HepRotationY::ty ( ) const
inline
double CLHEP::HepRotationY::tz ( ) const
inline
double CLHEP::HepRotationY::xt ( ) const
inline
double CLHEP::HepRotationY::xx ( ) const
inline

Referenced by distance2(), and phiX().

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

Referenced by phiY().

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

Referenced by distance2(), and phiZ().

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

Referenced by phiX().

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

Referenced by phiY().

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

Referenced by phiZ().

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

Referenced by distance2(), and thetaX().

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

Referenced by thetaY().

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

Referenced by distance2(), and thetaZ().

Friends And Related Function Documentation

HepRotationY inverseOf ( const HepRotationY r)
friend

Field Documentation

double CLHEP::HepRotationY::its_c
protected

Definition at line 263 of file RotationY.h.

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

double CLHEP::HepRotationY::its_d
protected

Definition at line 259 of file RotationY.h.

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

double CLHEP::HepRotationY::its_s
protected

Definition at line 262 of file RotationY.h.

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


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