java.lang.Object
org.apache.commons.math3.geometry.spherical.twod.Edge

public class Edge extends Object
Spherical polygons boundary edge.
Since:
3.3
See Also:
  • Field Details

    • start

      private final Vertex start
      Start vertex.
    • end

      private Vertex end
      End vertex.
    • length

      private final double length
      Length of the arc.
    • circle

      private final Circle circle
      Circle supporting the edge.
  • Constructor Details

    • Edge

      Edge(Vertex start, Vertex end, double length, Circle circle)
      Build an edge not contained in any node yet.
      Parameters:
      start - start vertex
      end - end vertex
      length - length of the arc (it can be greater than \( \pi \))
      circle - circle supporting the edge
  • Method Details

    • 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 from getStart()
      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, List<Edge> outsideList, 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 parts
      outsideList - list where to put parts that are outside of the split circle
      insideList - 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-edge
      subEnd - end of the sub-edge
      subLength - length of the sub-edge
      list - list where to put the sub-edge
      splitCircle - 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)