Class GreatCircles

java.lang.Object
org.apache.commons.geometry.spherical.twod.GreatCircles

public final class GreatCircles extends Object
Class containing factory methods for constructing GreatCircle and GreatCircleSubset instances.
  • 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 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:
      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:
      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

      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:
      IllegalArgumentException - if the actual great circle is not equivalent to the expected great circle