Class GreatArc
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
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final AngularInterval.Convex
The interval representing the region of the great circle contained in the arc. -
Constructor Summary
ConstructorsConstructorDescriptionGreatArc
(GreatCircle circle, AngularInterval.Convex interval) Create a new instance from a great circle and the interval embedded in it. -
Method Summary
Modifier and TypeMethodDescriptionReturn the end point of the arc, or null if the arc represents the full space.Get the angular interval for the arc.Return the midpoint of the arc, or null if the arc represents the full space.Return the start point of the arc, or null if the arc represents the full space.Get the embedded subspace region.reverse()
Reverse the orientation of the hyperplane for this instance, returning the result as a new instance.split
(Hyperplane<Point2S> splitter) Split this instance with the given hyperplane.toConvex()
Convert this instance into a list of convex child subsets representing the same region.toString()
Return a string representation of this great arc.Return a new hyperplane subset resulting from the application of the given transform.Methods inherited from class org.apache.commons.geometry.spherical.twod.GreatCircleSubset
classify, closest, getCentroid, getCircle, getHyperplane, getPrecision, getSize, isEmpty, isFull, toSpace, toSubspace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.commons.geometry.core.Embedding
toSpace, toSubspace
Methods inherited from interface org.apache.commons.geometry.core.partitioning.HyperplaneSubset
classify, closest, contains, getCentroid, getHyperplane, isEmpty, isFull
Methods inherited from interface org.apache.commons.geometry.core.Sized
getSize, isFinite, isInfinite
-
Field Details
-
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 instanceinterval
- convex angular interval embedded in the great circle
-
-
Method Details
-
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
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
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
Get the angular interval for the arc.- Returns:
- the angular interval for the arc
- See Also:
-
getSubspaceRegion
Get the embedded subspace region.- Specified by:
getSubspaceRegion
in interfaceRegionEmbedding<Point2S,
Point1S> - Specified by:
getSubspaceRegion
in classGreatCircleSubset
- Returns:
- the embedded subspace region
-
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 interfaceHyperplaneSubset<Point2S>
- Specified by:
toConvex
in classGreatCircleSubset
- Returns:
- a list of hyperplane convex subsets representing the same subspace region as this instance
-
split
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 interfaceHyperplaneConvexSubset<Point2S>
- Specified by:
split
in interfaceSplittable<Point2S,
HyperplaneSubset<Point2S>> - Parameters:
splitter
- the hyperplane to split this object with.- Returns:
- result of the split operation
-
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 interfaceHyperplaneConvexSubset<Point2S>
- Specified by:
transform
in interfaceHyperplaneSubset<Point2S>
- Parameters:
transform
- the transform instance to apply- Returns:
- new transformed hyperplane subset
-
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 interfaceHyperplaneConvexSubset<Point2S>
- Returns:
- a hyperplane convex subset representing the same region but with the opposite orientation.
-
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)
- Full arc
-