Class GreatCircles
java.lang.Object
org.apache.commons.geometry.spherical.twod.GreatCircles
Class containing factory methods for constructing
GreatCircle and GreatCircleSubset instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GreatArcarcFromInterval(GreatCircle circle, AngularInterval.Convex interval) Construct an arc from a great circle and an angular interval.static GreatArcarcFromPoints(Point2S start, Point2S end, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Construct an arc along the shortest path between the given points.static GreatCirclefromPoints(Point2S a, Point2S b, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a great circle instance from two points on the circle.static GreatCircleCreate a great circle instance from its pole vector.static GreatCirclefromPoleAndU(Vector3D pole, Vector3D u, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a great circle instance from its pole vector and a vector representing the u-axis in the equator plane.(package private) static voidvalidateGreatCirclesEquivalent(GreatCircle expected, GreatCircle actual) Validate that the actual great circle is equivalent to the expected great circle, throwing an exception if not.
-
Constructor Details
-
GreatCircles
private GreatCircles()Utility class; no instantiation.
-
-
Method Details
-
fromPole
public static GreatCircle fromPole(Vector3D pole, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a great circle instance from its pole vector. An arbitrary u-axis is chosen.- Parameters:
pole- pole vector for the great circleprecision- precision context used to compare floating point values- Returns:
- a great circle defined by the given pole vector
-
fromPoleAndU
public static GreatCircle fromPoleAndU(Vector3D pole, Vector3D u, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a great circle instance from its pole vector and a vector representing the u-axis in the equator plane. The u-axis vector defines the0pilocation for the embedded subspace.- Parameters:
pole- pole vector for the great circleu- u-axis direction for the equator planeprecision- precision context used to compare floating point values- Returns:
- a great circle defined by the given pole vector and u-axis direction
-
fromPoints
public static GreatCircle fromPoints(Point2S a, Point2S b, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a great circle instance from two points on the circle. The u-axis of the instance points to the location of the first point. The orientation of the circle is along the shortest path between the two points.- Parameters:
a- first point on the great circleb- second point on the great circleprecision- precision context used to compare floating point values- Returns:
- great circle instance containing the given points
- Throws:
IllegalArgumentException- if either of the given points is NaN or infinite, or if the given points are equal or antipodal as evaluated by the given precision context
-
arcFromPoints
public static GreatArc arcFromPoints(Point2S start, Point2S end, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Construct an arc along the shortest path between the given points. The underlying great circle is oriented in the direction fromstarttoend.- Parameters:
start- start point for the intervalend- end point point for the intervalprecision- precision context used to compare floating point numbers- Returns:
- an arc representing the shortest path between the given points
- Throws:
IllegalArgumentException- if either of the given points is NaN or infinite, or if the given points are equal or antipodal as evaluated by the given precision context- See Also:
-
arcFromInterval
Construct an arc from a great circle and an angular interval.- Parameters:
circle- circle defining the arcinterval- interval representing the portion of the circle contained in the arc- Returns:
- an arc created from the given great circle and interval
-
validateGreatCirclesEquivalent
Validate that the actual great circle is equivalent to the expected great circle, throwing an exception if not.- Parameters:
expected- the expected great circleactual- the actual great circle- Throws:
IllegalArgumentException- if the actual great circle is not equivalent to the expected great circle
-