OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
RBendGeometry.cpp
Go to the documentation of this file.
1 // ------------------------------------------------------------------------
2 // $RCSfile: RBendGeometry.cpp,v $
3 // ------------------------------------------------------------------------
4 // $Revision: 1.1.1.1 $
5 // ------------------------------------------------------------------------
6 // Copyright: see Copyright.readme
7 // ------------------------------------------------------------------------
8 //
9 // Class: RBendGeometry
10 // A Geometry which wraps a straight geometry to model the
11 // geometry of an RBend element.
12 //
13 // ------------------------------------------------------------------------
14 // Class category: BeamlineGeometry
15 // ------------------------------------------------------------------------
16 //
17 // $Date: 2000/03/27 09:32:34 $
18 // $Author: fci $
19 //
20 // ------------------------------------------------------------------------
21 
24 #include <cmath>
25 
26 
27 // Class RBendGeometry.
28 // ------------------------------------------------------------------------
29 
30 RBendGeometry::RBendGeometry(double length, double angle):
31  StraightGeometry(length), half_angle(angle / 2.0)
32 {}
33 
34 
36  StraightGeometry(*this), half_angle(rhs.half_angle)
37 {}
38 
39 
41 {}
42 
43 
45  double length = StraightGeometry::getElementLength();
46  return (half_angle == 0.0) ? length : length * half_angle / sin(half_angle);
47 }
48 
49 
52 }
53 
54 
56  return 2.0 * half_angle;
57 }
58 
59 
60 void RBendGeometry::setBendAngle(double angle) {
61  half_angle = angle / 2.0;
62 }
63 
64 
68  return patch * body * patch;
69 }
70 
71 
73  return
76 }
77 
78 
80  return
83 }
84 
85 
87  double d = getElementLength() / 4.0 * tan(half_angle / 2.0);
88  return
90 }
91 
92 
94  double d = getElementLength() / 4.0 * tan(half_angle / 2.0);
95  return
97 }
static Euclid3D translation(double x, double y, double z)
Make translation.
Definition: Euclid3D.cpp:152
Euclid3D getExitPatch() const
Get patch.
virtual double getArcLength() const
Get arc length.
Tps< T > sin(const Tps< T > &x)
Sine.
Definition: TpsMath.h:111
Euclid3D getEntrancePatch() const
Get patch.
Tps< T > tan(const Tps< T > &x)
Tangent.
Definition: TpsMath.h:147
RBendGeometry(double length, double angle)
Constructor.
static Euclid3D YRotation(double angle)
Make rotation.
Definition: Euclid3D.cpp:164
Euclid3D getTotalTransform() const
Get transform.
virtual ~RBendGeometry()
Displacement and rotation in space.
Definition: Euclid3D.h:68
Euclid3D getExitFrame() const
Get transform.
virtual double getElementLength() const
Get element length.
Euclid3D getTotalTransform() const
Get transform.
A geometry representing a straight line.
The geometry for a RBend element.
Definition: RBendGeometry.h:41
Euclid3D getEntranceFrame() const
Get transform.
void setBendAngle(double angle)
Set angle.
virtual double getElementLength() const
Get design length.
Euclid3D getExitFrame() const
Get transform.
virtual double getBendAngle() const
Get angle.
Euclid3D getEntranceFrame() const
Get transform.