Class Edge
java.lang.Object
org.apache.commons.math3.geometry.spherical.twod.Edge
Spherical polygons boundary edge.
- Since:
- 3.3
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Vertex
Add a sub-edge to a list if long enough.Get the circle supporting this edge.getEnd()
Get end vertex.double
Get the length of the arc.getPointAt
(double alpha) Get an intermediate point.getStart()
Get start vertex.(package private) void
setNextEdge
(Edge next) Connect the instance with a following edge.(package private) void
Split the edge.
-
Field Details
-
start
Start vertex. -
end
End vertex. -
length
private final double lengthLength of the arc. -
circle
Circle supporting the edge.
-
-
Constructor Details
-
Edge
Build an edge not contained in any node yet.- Parameters:
start
- start vertexend
- end vertexlength
- length of the arc (it can be greater than \( \pi \))circle
- circle supporting the edge
-
-
Method Details
-
getStart
Get start vertex.- Returns:
- start vertex
-
getEnd
Get end vertex.- Returns:
- end vertex
-
getLength
public double getLength()Get the length of the arc.- Returns:
- length of the arc (can be greater than \( \pi \))
-
getCircle
Get the circle supporting this edge.- Returns:
- circle supporting this edge
-
getPointAt
Get an intermediate point.The angle along the edge should normally be between 0 and
getLength()
in order to remain within edge limits. However, there are no checks on the value of the angle, so user can rebuild the full circle on which an edge is defined if they want.- Parameters:
alpha
- angle along the edge, counted fromgetStart()
- Returns:
- an intermediate point
-
setNextEdge
Connect the instance with a following edge.- Parameters:
next
- edge following the instance
-
split
Split the edge.Once split, this edge is not referenced anymore by the vertices, it is replaced by the two or three sub-edges and intermediate splitting vertices are introduced to connect these sub-edges together.
- Parameters:
splitCircle
- circle splitting the edge in several partsoutsideList
- list where to put parts that are outside of the split circleinsideList
- list where to put parts that are inside the split circle
-
addSubEdge
private Vertex addSubEdge(Vertex subStart, Vertex subEnd, double subLength, List<Edge> list, Circle splitCircle) Add a sub-edge to a list if long enough.If the length of the sub-edge to add is smaller than the
Circle.getTolerance()
tolerance of the support circle, it will be ignored.- Parameters:
subStart
- start of the sub-edgesubEnd
- end of the sub-edgesubLength
- length of the sub-edgelist
- list where to put the sub-edgesplitCircle
- circle splitting the edge in several parts- Returns:
- end vertex of the edge (
subEnd
if the edge was long enough and really added,subStart
if the edge was too small and therefore ignored)
-