OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
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
23#include <cmath>
25
26// Class RBendGeometry.
27// ------------------------------------------------------------------------
28
29RBendGeometry::RBendGeometry(double length, double angle)
30 : StraightGeometry(length), half_angle(angle / 2.0) {}
31
33 : StraightGeometry(rhs), half_angle(rhs.half_angle) {}
34
36
38 double length = StraightGeometry::getElementLength();
39 return (half_angle == 0.0) ? length : length * half_angle / sin(half_angle);
40}
41
42double RBendGeometry::getBendAngle() const { return 2.0 * half_angle; }
43
44void RBendGeometry::setBendAngle(double angle) { half_angle = angle / 2.0; }
45
51
55
59
61 double d = getElementLength() / 4.0 * tan(half_angle / 2.0);
63}
64
66 double d = getElementLength() / 4.0 * tan(half_angle / 2.0);
68}
Displacement and rotation in space.
Definition Euclid3D.h:67
static Euclid3D YRotation(double angle)
Make rotation.
Definition Euclid3D.cpp:109
static Euclid3D translation(double x, double y, double z)
Make translation.
Definition Euclid3D.cpp:99
The geometry for a RBend element.
void setBendAngle(double angle)
Set angle.
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.