Class GreatCircles


  • public final class GreatCircles
    extends java.lang.Object
    Class containing factory methods for constructing GreatCircle and GreatCircleSubset 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GreatCircles

        private GreatCircles()
        Utility class; no instantiation.
    • 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 circle
        precision - 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 the 0pi location for the embedded subspace.
        Parameters:
        pole - pole vector for the great circle
        u - u-axis direction for the equator plane
        precision - 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 circle
        b - second point on the great circle
        precision - 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 from start to end.
        Parameters:
        start - start point for the interval
        end - end point point for the interval
        precision - 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 arc
        interval - 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 circle
        actual - the actual great circle
        Throws:
        java.lang.IllegalArgumentException - if the actual great circle is not equivalent to the expected great circle