CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
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
Generated on Sun Jun 17 2012 08:08:27 for CLHEP by
1.8.1.1