OPAL (Object Oriented Parallel Accelerator Library)  2024.1
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 
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 }
Euclid3D getTotalTransform() const
Get transform.
Euclid3D getEntranceFrame() const
Get transform.
double half_angle
Definition: RBendGeometry.h:96
void setBendAngle(double angle)
Set angle.
The geometry for a RBend element.
Definition: RBendGeometry.h:41
item[EANGLE] Entrance edge angle(radians).\item[ROTATION] Rotation of the magnet about its central axis(radians
Tps< T > tan(const Tps< T > &x)
Tangent.
Definition: TpsMath.h:147
virtual ~RBendGeometry()
A geometry representing a straight line.
Euclid3D getExitPatch() const
Get patch.
virtual double getElementLength() const
Get design length.
Euclid3D getTotalTransform() const
Get transform.
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
RBendGeometry(double length, double angle)
Constructor.
virtual double getBendAngle() const
Get angle.
Euclid3D getEntrancePatch() const
Get patch.
Displacement and rotation in space.
Definition: Euclid3D.h:68
Euclid3D getExitFrame() const
Get transform.
Tps< T > sin(const Tps< T > &x)
Sine.
Definition: TpsMath.h:111
Euclid3D getExitFrame() const
Get transform.
virtual double getArcLength() const
Get arc length.
Euclid3D getEntranceFrame() const
Get transform.