CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Vector
src
RotationP.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
// ---------------------------------------------------------------------------
3
//
4
// This file is a part of the CLHEP - a Class Library for High Energy Physics.
5
//
6
// This is the implementation of methods of the HepRotation class which
7
// were introduced when ZOOM PhysicsVectors was merged in, other than those
8
// involving Euler or axis/angle representations, lengthy corrections of
9
// the rotation matrix, or I/O.
10
//
11
12
#ifdef GNUPRAGMA
13
#pragma implementation
14
#endif
15
16
#include "CLHEP/Vector/defs.h"
17
#include "CLHEP/Vector/Rotation.h"
18
19
#include <cmath>
20
21
22
23
namespace
CLHEP
{
24
25
void
HepRotation::decompose
(
HepAxisAngle
& rotation,
Hep3Vector
& boost)
const
{
26
boost.
set
(0,0,0);
27
rotation =
axisAngle
();
28
}
29
30
void
HepRotation::decompose
(
Hep3Vector
& boost,
HepAxisAngle
& rotation)
const
{
31
boost.
set
(0,0,0);
32
rotation =
axisAngle
();
33
}
34
35
double
HepRotation::distance2
(
const
HepRotation
& r )
const
{
36
double
sum =
rxx
* r.
rxx
+
rxy
* r.
rxy
+
rxz
* r.
rxz
37
+
ryx
* r.
ryx
+
ryy
* r.
ryy
+
ryz
* r.
ryz
38
+
rzx
* r.
rzx
+
rzy
* r.
rzy
+
rzz
* r.
rzz
;
39
double
answer = 3.0 - sum;
40
return
(answer >= 0 ) ? answer : 0;
41
}
42
43
double
HepRotation::howNear
(
const
HepRotation
& r )
const
{
44
return
std::sqrt(
distance2
( r ) );
45
}
46
47
bool
HepRotation::isNear
(
const
HepRotation
& r,
48
double
epsilon)
const
{
49
return
distance2
( r ) <= epsilon*epsilon;
50
}
51
52
double
HepRotation::norm2
()
const
{
53
double
answer = 3.0 -
rxx
-
ryy
-
rzz
;
54
return
(answer >= 0 ) ? answer : 0;
55
}
56
57
}
// namespace CLHEP
CLHEP::HepAxisAngle
Definition:
Geometry/CLHEP/Vector/AxisAngle.h:37
CLHEP::HepRotation::rxx
double rxx
Definition:
Geometry/CLHEP/Vector/Rotation.h:389
CLHEP::HepRotation::rxz
double rxz
Definition:
Geometry/CLHEP/Vector/Rotation.h:389
CLHEP::HepRotation::howNear
double howNear(const HepRotation &r) const
Definition:
RotationP.cc:43
CLHEP::HepRotation::isNear
bool isNear(const HepRotation &r, double epsilon=Hep4RotationInterface::tolerance) const
Definition:
RotationP.cc:47
CLHEP::HepRotation
Definition:
Geometry/CLHEP/Vector/Rotation.h:48
CLHEP::HepRotation::ryz
double ryz
Definition:
Geometry/CLHEP/Vector/Rotation.h:390
CLHEP::HepRotation::rxy
double rxy
Definition:
Geometry/CLHEP/Vector/Rotation.h:389
CLHEP
Definition:
ClhepVersion.h:13
CLHEP::HepRotation::rzy
double rzy
Definition:
Geometry/CLHEP/Vector/Rotation.h:391
CLHEP::HepRotation::ryy
double ryy
Definition:
Geometry/CLHEP/Vector/Rotation.h:390
CLHEP::HepRotation::axisAngle
HepAxisAngle axisAngle() const
Definition:
RotationA.cc:105
CLHEP::Hep3Vector
Definition:
Geometry/CLHEP/Vector/ThreeVector.h:41
CLHEP::HepRotation::rzz
double rzz
Definition:
Geometry/CLHEP/Vector/Rotation.h:391
CLHEP::HepRotation::rzx
double rzx
Definition:
Geometry/CLHEP/Vector/Rotation.h:391
CLHEP::HepRotation::ryx
double ryx
Definition:
Geometry/CLHEP/Vector/Rotation.h:390
CLHEP::HepRotation::distance2
double distance2(const HepRotation &r) const
Definition:
RotationP.cc:35
CLHEP::HepRotation::decompose
void decompose(HepAxisAngle &rotation, Hep3Vector &boost) const
Definition:
RotationP.cc:25
CLHEP::Hep3Vector::set
void set(double x, double y, double z)
CLHEP::HepRotation::norm2
double norm2() const
Definition:
RotationP.cc:52
Generated by
1.8.17