java.lang.Object
simpa.acc.api.create.ReferenceOrbit
A reference orbit.
-
Constructor Summary
ConstructorsConstructorDescriptionReferenceOrbit
(String filename, boolean circular, LocalFramesCalculator.Strategy strategy, org.apache.commons.math3.geometry.euclidean.threed.Vector3D vertical) Create a reference orbit from points in a file.ReferenceOrbit
(List<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> points, boolean circular, LocalFramesCalculator.Strategy strategy, org.apache.commons.math3.geometry.euclidean.threed.Vector3D vertical) Creates a reference orbit from a list of points.ReferenceOrbit
(ReferenceOrbit original, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation) Deep copy constructor with rotation and translation. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getLongitudinalPosition
(int index) Gets the longitudinal position of the point on the orbit with the given index.double
The approximated length calculated by adding together the line segments of the orbit.List
<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> Gets all the orbit points that make up the reference orbit.org.apache.commons.math3.geometry.euclidean.threed.Vector3D
getPreviousPoint
(int index) Get the previous point on the orbit compared to the point designated by the given index.getTangentVectorAt
(double longiPos) Gets the tangent vector (position and direction vectors) on the orbit which is at a given longitudinal position.getTangentVectorAt
(int index) Gets the tangent vector (position and direction vectors) on the orbit which is at the given index of the point on the orbit.boolean
void
localFramesToFile
(String fileName, int increment) Writes the reference frame unit vectors into a filevoid
writeMaptoFileWithS
(String fileName, Map<String, org.apache.commons.math3.geometry.euclidean.threed.Vector3D> map) Writes the the map into a file sorted by longitudinal position with the following layout: s[m] x[m] y[m] z[m] ElementName s is the longitudinal position along the orbit.void
Writes the reference orbit to a file with the given name.
-
Constructor Details
-
ReferenceOrbit
public ReferenceOrbit(ReferenceOrbit original, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation) Deep copy constructor with rotation and translation.- Parameters:
original
-rot
-translation
-
-
ReferenceOrbit
public ReferenceOrbit(List<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> points, boolean circular, LocalFramesCalculator.Strategy strategy, org.apache.commons.math3.geometry.euclidean.threed.Vector3D vertical) Creates a reference orbit from a list of points.- Parameters:
points
- the points to create the orbit fromcircular
- true is the orbit is closed (circular)strategy
- A strategy how to define the local coordinate system. Can be null, in this case LocalFramesCalculator.DEFAULT_STRATEGY is used.vertical
- The preferred vertical direction.
-
ReferenceOrbit
public ReferenceOrbit(String filename, boolean circular, LocalFramesCalculator.Strategy strategy, org.apache.commons.math3.geometry.euclidean.threed.Vector3D vertical) Create a reference orbit from points in a file.- Parameters:
filename
- input filecircular
- true is the orbit is closed (circular)
-
-
Method Details
-
getLocalFrames
- Returns:
- The local frames at each point of the orbit
-
localFramesToFile
Writes the reference frame unit vectors into a file- Parameters:
fileName
- Output file name.increment
- Increment of steps while sampling the curve. The value 1 takes all the curve points, 2 every second, 3 every third and so on.
-
getPreviousPoint
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getPreviousPoint(int index) Get the previous point on the orbit compared to the point designated by the given index. It takes into account if the orbit is circular or belongs to a transfer line. 1. In transfer lines the point with index zero is always the origin. 2. In circular machines point with index zero is (0,0 ds) where ds is the resolution of the orbit step size. The last point in the path is always the origin (0,0,0).- Parameters:
index
- Index of the current orbit point.- Returns:
- The previous index of the orbit.
-
isCircular
public boolean isCircular()- Returns:
- true is the orbit is circular.
-
getOrbitLength
public double getOrbitLength()The approximated length calculated by adding together the line segments of the orbit.- Returns:
- the length of the orbit
-
getOrbitPoints
Gets all the orbit points that make up the reference orbit.- Returns:
- The points that make up the reference orbit.
-
writeToFile
Writes the reference orbit to a file with the given name.- Parameters:
f
- Output file name.
-
getTangentVectorAt
Gets the tangent vector (position and direction vectors) on the orbit which is at a given longitudinal position.- Parameters:
longiPos
- Longitudinal position. Distance from the start along the orbit[m].- Returns:
- Tangent vector at the orbit.
-
getTangentVectorAt
Gets the tangent vector (position and direction vectors) on the orbit which is at the given index of the point on the orbit.- Parameters:
index
- Index of the point on the orbit.- Returns:
- Tangent vector at the orbit.
-
getLongitudinalPosition
public double getLongitudinalPosition(int index) Gets the longitudinal position of the point on the orbit with the given index.- Parameters:
index
- Index of the orbit point- Returns:
- The longitudinal position of the point on the orbit with the given index. [meters]
-
writeMaptoFileWithS
public void writeMaptoFileWithS(String fileName, Map<String, org.apache.commons.math3.geometry.euclidean.threed.Vector3D> map) Writes the the map into a file sorted by longitudinal position with the following layout: s[m] x[m] y[m] z[m] ElementName s is the longitudinal position along the orbit.- Parameters:
fileName
- Output file.map
- A map containing Strings as keys and 3D points as values. These are usually the element centers. In any case should be close to the reference orbit. The longitudinal position calculation assumes the points lie on the reference orbit.
-