OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
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(rhs), 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 
51  return 2.0 * half_angle;
52 }
53 
54 
55 void RBendGeometry::setBendAngle(double angle) {
56  half_angle = angle / 2.0;
57 }
58 
59 
63  return patch * body * patch;
64 }
65 
66 
68  return
71 }
72 
73 
75  return
78 }
79 
80 
82  double d = getElementLength() / 4.0 * tan(half_angle / 2.0);
83  return
85 }
86 
87 
89  double d = getElementLength() / 4.0 * tan(half_angle / 2.0);
90  return
92 }
Tps< T > tan(const Tps< T > &x)
Tangent.
Definition: TpsMath.h:147
Tps< T > sin(const Tps< T > &x)
Sine.
Definition: TpsMath.h:111
Displacement and rotation in space.
Definition: Euclid3D.h:68
static Euclid3D YRotation(double angle)
Make rotation.
Definition: Euclid3D.cpp:164
static Euclid3D translation(double x, double y, double z)
Make translation.
Definition: Euclid3D.cpp:152
The geometry for a RBend element.
Definition: RBendGeometry.h:41
void setBendAngle(double angle)
Set angle.
double half_angle
Definition: RBendGeometry.h:96
virtual double getBendAngle() const
Get angle.
Euclid3D getExitFrame() const
Get transform.
virtual double getArcLength() const
Get arc length.
Euclid3D getEntranceFrame() const
Get transform.
Euclid3D getEntrancePatch() const
Get patch.
RBendGeometry(double length, double angle)
Constructor.
virtual ~RBendGeometry()
Euclid3D getExitPatch() const
Get patch.
Euclid3D getTotalTransform() const
Get transform.
A geometry representing a straight line.
virtual double getElementLength() const
Get design length.
Euclid3D getEntranceFrame() const
Get transform.
Euclid3D getExitFrame() const
Get transform.
Euclid3D getTotalTransform() const
Get transform.