java.lang.Object
org.apache.commons.geometry.spherical.twod.GreatCircleSubset
org.apache.commons.geometry.spherical.twod.GreatArc
All Implemented Interfaces:
Embedding<Point2S,Point1S>, HyperplaneConvexSubset<Point2S>, HyperplaneSubset<Point2S>, Splittable<Point2S,HyperplaneSubset<Point2S>>, RegionEmbedding<Point2S,Point1S>, Sized

public final class GreatArc extends GreatCircleSubset implements HyperplaneConvexSubset<Point2S>
Class representing a single, convex angular interval in a GreatCircle. Convex angular intervals are those where the shortest path between all pairs of points in the interval are completely contained in the interval. In the case of paths that tie for the shortest length, it is sufficient that one of the paths is completely contained in the interval. In spherical 2D space, convex arcs either fill the entire great circle or have an angular size of less than or equal to pi radians.

Instances of this class are guaranteed to be immutable.

See Also:
  • Field Details

    • interval

      private final AngularInterval.Convex interval
      The interval representing the region of the great circle contained in the arc.
  • Constructor Details

    • GreatArc

      GreatArc(GreatCircle circle, AngularInterval.Convex interval)
      Create a new instance from a great circle and the interval embedded in it.
      Parameters:
      circle - defining great circle instance
      interval - convex angular interval embedded in the great circle
  • Method Details

    • getStartPoint

      public Point2S getStartPoint()
      Return the start point of the arc, or null if the arc represents the full space.
      Returns:
      the start point of the arc, or null if the arc represents the full space.
    • getEndPoint

      public Point2S getEndPoint()
      Return the end point of the arc, or null if the arc represents the full space.
      Returns:
      the end point of the arc, or null if the arc represents the full space.
    • getMidPoint

      public Point2S getMidPoint()
      Return the midpoint of the arc, or null if the arc represents the full space.
      Returns:
      the midpoint of the arc, or null if the arc represents the full space.
    • getInterval

      public AngularInterval.Convex getInterval()
      Get the angular interval for the arc.
      Returns:
      the angular interval for the arc
      See Also:
    • getSubspaceRegion

      public AngularInterval.Convex getSubspaceRegion()
      Get the embedded subspace region.
      Specified by:
      getSubspaceRegion in interface RegionEmbedding<Point2S,Point1S>
      Specified by:
      getSubspaceRegion in class GreatCircleSubset
      Returns:
      the embedded subspace region
    • toConvex

      public List<GreatArc> toConvex()
      Convert this instance into a list of convex child subsets representing the same region. Implementations are not required to return an optimal convex subdivision of the current instance. They are free to return whatever subdivision is readily available.
      Specified by:
      toConvex in interface HyperplaneSubset<Point2S>
      Specified by:
      toConvex in class GreatCircleSubset
      Returns:
      a list of hyperplane convex subsets representing the same subspace region as this instance
    • split

      public Split<GreatArc> split(Hyperplane<Point2S> splitter)
      Split this instance with the given hyperplane.

      The parts resulting from a split operation with a convex subset are guaranteed to also be convex.

      Specified by:
      split in interface HyperplaneConvexSubset<Point2S>
      Specified by:
      split in interface Splittable<Point2S,HyperplaneSubset<Point2S>>
      Parameters:
      splitter - the hyperplane to split this object with.
      Returns:
      result of the split operation
    • transform

      public GreatArc transform(Transform<Point2S> transform)
      Return a new hyperplane subset resulting from the application of the given transform. The current instance is not modified.

      Hyperplane convex subsets subjected to affine transformations remain convex.

      Specified by:
      transform in interface HyperplaneConvexSubset<Point2S>
      Specified by:
      transform in interface HyperplaneSubset<Point2S>
      Parameters:
      transform - the transform instance to apply
      Returns:
      new transformed hyperplane subset
    • reverse

      public GreatArc reverse()
      Reverse the orientation of the hyperplane for this instance, returning the result as a new instance. The returned subset contains the same points but has a reversed orientation.
      Specified by:
      reverse in interface HyperplaneConvexSubset<Point2S>
      Returns:
      a hyperplane convex subset representing the same region but with the opposite orientation.
    • toString

      public String toString()
      Return a string representation of this great arc.

      In order to keep the string representation short but useful, the exact format of the return value depends on the properties of the arc. See below for examples.

      • Full arc
        • GreatArc[full= true, circle= GreatCircle[pole= (0.0, 0.0, 1.0), x= (1.0, 0.0, 0.0), y= (0.0, 1.0, 0.0)]
      • Non-full arc
        • GreatArc[start= (1.0, 1.5707963267948966), end= (2.0, 1.5707963267948966)
      Overrides:
      toString in class Object