Class GreatCircles
- java.lang.Object
-
- org.apache.commons.geometry.spherical.twod.GreatCircles
-
public final class GreatCircles extends java.lang.Object
Class containing factory methods for constructingGreatCircle
andGreatCircleSubset
instances.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
GreatCircles()
Utility class; no instantiation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GreatArc
arcFromInterval(GreatCircle circle, AngularInterval.Convex interval)
Construct an arc from a great circle and an angular interval.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.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.static GreatCircle
fromPole(Vector3D pole, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Create a great circle instance from its pole vector.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.(package private) static void
validateGreatCirclesEquivalent(GreatCircle expected, GreatCircle actual)
Validate that the actual great circle is equivalent to the expected great circle, throwing an exception if not.
-
-
-
Method Detail
-
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 the0pi
location 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:
java.lang.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 fromstart
toend
.- 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:
java.lang.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:
fromPoints(Point2S, Point2S, org.apache.commons.numbers.core.Precision.DoubleEquivalence)
-
arcFromInterval
public static GreatArc arcFromInterval(GreatCircle circle, AngularInterval.Convex interval)
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
static void validateGreatCirclesEquivalent(GreatCircle expected, GreatCircle actual)
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:
java.lang.IllegalArgumentException
- if the actual great circle is not equivalent to the expected great circle
-
-