Class Quadrilateral

  • All Implemented Interfaces:
    Cloneable

    public class Quadrilateral
    extends Object
    implements Cloneable
    A simple four-sided polygon.
    • Constructor Summary

      Constructors 
      Constructor Description
      Quadrilateral​(org.locationtech.jts.geom.Coordinate p1, org.locationtech.jts.geom.Coordinate p2, org.locationtech.jts.geom.Coordinate p3, org.locationtech.jts.geom.Coordinate p4)
      Creates a Quadrilateral.
    • Constructor Detail

      • Quadrilateral

        public Quadrilateral​(org.locationtech.jts.geom.Coordinate p1,
                             org.locationtech.jts.geom.Coordinate p2,
                             org.locationtech.jts.geom.Coordinate p3,
                             org.locationtech.jts.geom.Coordinate p4)
        Creates a Quadrilateral.
        Parameters:
        p1 - one vertex
        p2 - another vertex
        p3 - another vertex
        p4 - another vertex
    • Method Detail

      • getEnvelope

        public org.locationtech.jts.geom.Envelope getEnvelope()
      • isConvex

        public boolean isConvex()
        Returns whether this Quadrilateral is a convex polygon.
        Returns:
        whether the diagonals intersect
      • triangles

        public List triangles()
        Creates two Triangles from this Quadrilateral.
        Returns:
        two Triangles: P1-P2-P3 and P1-P4-P3
      • getP1

        public org.locationtech.jts.geom.Coordinate getP1()
        Returns the first vertex.
        Returns:
        the first vertex
      • getP2

        public org.locationtech.jts.geom.Coordinate getP2()
        Returns the second vertex.
        Returns:
        the second vertex
      • getP3

        public org.locationtech.jts.geom.Coordinate getP3()
        Returns the third vertex.
        Returns:
        the third vertex
      • getP4

        public org.locationtech.jts.geom.Coordinate getP4()
        Returns the fourth vertex.
        Returns:
        the fourth vertex
      • toPolygon

        public org.locationtech.jts.geom.Polygon toPolygon()
        Converts this Quadrilateral to a JTS Polygon.
        Returns:
        a new JTS Polygon with one shell and no holes
      • verticesOutside

        public Collection verticesOutside​(Collection vertices)
        Filters out points that lie inside this Quadrilateral
        Parameters:
        vertices - points to check
        Returns:
        those points which lie outside this Quadrilateral