Class Edge
- java.lang.Object
-
- org.apache.commons.math3.geometry.spherical.twod.Edge
-
public class Edge extends java.lang.Object
Spherical polygons boundary edge.- Since:
- 3.3
- See Also:
SphericalPolygonsSet.getBoundaryLoops()
,Vertex
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Vertex
addSubEdge(Vertex subStart, Vertex subEnd, double subLength, java.util.List<Edge> list, Circle splitCircle)
Add a sub-edge to a list if long enough.Circle
getCircle()
Get the circle supporting this edge.Vertex
getEnd()
Get end vertex.double
getLength()
Get the length of the arc.Vector3D
getPointAt(double alpha)
Get an intermediate point.Vertex
getStart()
Get start vertex.(package private) void
setNextEdge(Edge next)
Connect the instance with a following edge.(package private) void
split(Circle splitCircle, java.util.List<Edge> outsideList, java.util.List<Edge> insideList)
Split the edge.
-
-
-
Method Detail
-
getStart
public Vertex getStart()
Get start vertex.- Returns:
- start vertex
-
getEnd
public 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
public Circle getCircle()
Get the circle supporting this edge.- Returns:
- circle supporting this edge
-
getPointAt
public Vector3D getPointAt(double alpha)
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
void setNextEdge(Edge next)
Connect the instance with a following edge.- Parameters:
next
- edge following the instance
-
split
void split(Circle splitCircle, java.util.List<Edge> outsideList, java.util.List<Edge> insideList)
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, java.util.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-edgesplitCircle
- circle splitting the edge in several partslist
- list where to put the sub-edge- 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)
-
-