27 double r1 = axis.
mag();
29 std::cerr <<
"Hep3Vector::rotate() - "
30 <<
"Attempt to rotate around a zero vector axis! " << std::endl;
33 register double scale=1.0/r1;
34 register double ux = scale*axis.
getX();
35 register double uy = scale*axis.
getY();
36 register double uz = scale*axis.
getZ();
37 double cd = std::cos(ddelta);
38 double sd = std::sin(ddelta);
39 register double ocd = 1 - cd;
44 {
register double ocdux = ocd * ux;
45 rx =
dx * ( cd + ocdux * ux ) +
46 dy * ( ocdux * uy - sd * uz ) +
47 dz * ( ocdux * uz + sd * uy ) ;
50 {
register double ocduy = ocd * uy;
51 ry =
dy * ( cd + ocduy * uy ) +
52 dz * ( ocduy * uz - sd * ux ) +
53 dx * ( ocduy * ux + sd * uz ) ;
56 {
register double ocduz = ocd * uz;
57 rz =
dz * ( cd + ocduz * uz ) +
58 dx * ( ocduz * ux - sd * uy ) +
59 dy * ( ocduz * uy + sd * ux ) ;
82 register double sinPhi = std::sin( phi1 ), cosPhi = std::cos( phi1 );
83 register double sinTheta = std::sin( theta1 ), cosTheta1 = std::cos( theta1 );
84 register double sinPsi = std::sin( psi1 ), cosPsi = std::cos( psi1 );
86 rx = (cosPsi * cosPhi - cosTheta1 * sinPsi * sinPhi) *
dx +
87 (cosPsi * sinPhi + cosTheta1 * sinPsi * cosPhi) *
dy +
88 (sinPsi * sinTheta) *
dz ;
90 ry = (- sinPsi * cosPhi - cosTheta1 * cosPsi * sinPhi) *
dx +
91 (- sinPsi * sinPhi + cosTheta1 * cosPsi * cosPhi) *
dy +
92 (cosPsi * sinTheta) *
dz ;
94 rz = (sinTheta * sinPhi) *
dx +
95 (- sinTheta * cosPhi) *
dy +
135 return vv.
rotate(axis, ddelta);
144 double phi,
double theta,
double psi) {
146 return vv.
rotate(phi, theta, psi);
Hep3Vector & rotateY(double)
Hep3Vector & rotateX(double)
Hep3Vector & rotateZ(double)
Hep3Vector & rotate(double, const Hep3Vector &)
Hep3Vector getAxis() const
HepLorentzVector rotationYOf(const HepLorentzVector &vec, double delta)
HepLorentzVector rotationXOf(const HepLorentzVector &vec, double delta)
HepLorentzVector rotationZOf(const HepLorentzVector &vec, double delta)
HepLorentzVector rotationOf(const HepLorentzVector &vec, const Hep3Vector &axis, double delta)