Class Quadrilateral

java.lang.Object
com.vividsolutions.jump.warp.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.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Object
     
    org.locationtech.jts.geom.Envelope
     
    org.locationtech.jts.geom.Coordinate
    Returns the first vertex.
    org.locationtech.jts.geom.Coordinate
    Returns the second vertex.
    org.locationtech.jts.geom.Coordinate
    Returns the third vertex.
    org.locationtech.jts.geom.Coordinate
    Returns the fourth vertex.
    boolean
    Returns whether this Quadrilateral is a convex polygon.
    org.locationtech.jts.geom.Polygon
    Converts this Quadrilateral to a JTS Polygon.
     
    Creates two Triangles from this Quadrilateral.
    Filters out points that lie inside this Quadrilateral

    Methods inherited from class Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • 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 Details

    • getEnvelope

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

      protected Object clone()
      Overrides:
      clone in class Object
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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