Class Quadrilateral
java.lang.Object
com.vividsolutions.jump.warp.Quadrilateral
- All Implemented Interfaces:
Cloneable
-
Constructor Summary
ConstructorsConstructorDescriptionQuadrilateral(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 TypeMethodDescriptionprotected Objectclone()org.locationtech.jts.geom.Envelopeorg.locationtech.jts.geom.CoordinategetP1()Returns the first vertex.org.locationtech.jts.geom.CoordinategetP2()Returns the second vertex.org.locationtech.jts.geom.CoordinategetP3()Returns the third vertex.org.locationtech.jts.geom.CoordinategetP4()Returns the fourth vertex.booleanisConvex()Returns whether this Quadrilateral is a convex polygon.org.locationtech.jts.geom.PolygonConverts this Quadrilateral to a JTS Polygon.toString()Creates two Triangles from this Quadrilateral.verticesOutside(Collection vertices) Filters out points that lie inside this Quadrilateral
-
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 vertexp2- another vertexp3- another vertexp4- another vertex
-
-
Method Details
-
getEnvelope
public org.locationtech.jts.geom.Envelope getEnvelope() -
clone
-
isConvex
public boolean isConvex()Returns whether this Quadrilateral is a convex polygon.- Returns:
- whether the diagonals intersect
-
triangles
Creates two Triangles from this Quadrilateral.- Returns:
- two Triangles: P1-P2-P3 and P1-P4-P3
-
toString
-
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
Filters out points that lie inside this Quadrilateral- Parameters:
vertices- points to check- Returns:
- those points which lie outside this Quadrilateral
-