public class Triangle
extends java.lang.Object
BilinearInterpolatedTransform
Constructor and Description |
---|
Triangle(com.vividsolutions.jts.geom.Coordinate p1,
com.vividsolutions.jts.geom.Coordinate p2,
com.vividsolutions.jts.geom.Coordinate p3)
Creates a Triangle.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(com.vividsolutions.jts.geom.Coordinate p)
Returns whether this Triangle contains the given coordinate
|
boolean |
equals(java.lang.Object o)
Returns whether this Triangle has the same vertices as the given Triangle
|
double |
getArea()
Returns the area of the triangle.
|
com.vividsolutions.jts.geom.Envelope |
getEnvelope()
Returns the bounds of this Triangle.
|
double |
getMaxSideLength()
Returns the length of this Triangle's longest side.
|
double |
getMinHeight()
Returns the smallest of this Triangle's three heights (as measured
perpendicularly from each side).
|
com.vividsolutions.jts.geom.Coordinate |
getP1()
Returns the first vertex.
|
com.vividsolutions.jts.geom.Coordinate |
getP2()
Returns the second vertex.
|
com.vividsolutions.jts.geom.Coordinate |
getP3()
Returns the third vertex.
|
int |
hashCode() |
boolean |
hasVertex(com.vividsolutions.jts.geom.Coordinate v)
Returns whether v is one of this Triangle's vertices.
|
protected com.vividsolutions.jts.geom.Coordinate |
min(com.vividsolutions.jts.geom.Coordinate a,
com.vividsolutions.jts.geom.Coordinate b) |
java.util.List |
subTriangles(com.vividsolutions.jts.geom.Coordinate newVertex)
Returns the three triangles that result from splitting this triangle at
a given point.
|
com.vividsolutions.jts.geom.Coordinate |
toEuclideanCoordinate(com.vividsolutions.jts.geom.Coordinate simplicialCoordinate)
Converts from a simplicial coordinate to a Euclidean coordinate.
|
com.vividsolutions.jts.geom.LinearRing |
toLinearRing()
Converts this Triangle to a JTS Geometry.
|
com.vividsolutions.jts.geom.Coordinate |
toSimplicialCoordinate(com.vividsolutions.jts.geom.Coordinate euclideanCoordinate)
Converts from a Euclidean coordinate to a simplicial coordinate.
|
java.lang.String |
toString() |
public Triangle(com.vividsolutions.jts.geom.Coordinate p1, com.vividsolutions.jts.geom.Coordinate p2, com.vividsolutions.jts.geom.Coordinate p3)
p1
- one vertexp2
- another vertexp3
- another vertexpublic com.vividsolutions.jts.geom.Coordinate getP1()
public com.vividsolutions.jts.geom.Coordinate getP2()
public com.vividsolutions.jts.geom.Coordinate getP3()
public double getMinHeight()
public double getArea()
public double getMaxSideLength()
public com.vividsolutions.jts.geom.LinearRing toLinearRing()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean contains(com.vividsolutions.jts.geom.Coordinate p)
p
- the point to test for containmentpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- another Triangle; otherwise, equals will return falsepublic boolean hasVertex(com.vividsolutions.jts.geom.Coordinate v)
v
- the candidate pointpublic int hashCode()
hashCode
in class java.lang.Object
public java.util.List subTriangles(com.vividsolutions.jts.geom.Coordinate newVertex)
newVertex
- the split point, which must be inside triangleprotected com.vividsolutions.jts.geom.Coordinate min(com.vividsolutions.jts.geom.Coordinate a, com.vividsolutions.jts.geom.Coordinate b)
public com.vividsolutions.jts.geom.Coordinate toSimplicialCoordinate(com.vividsolutions.jts.geom.Coordinate euclideanCoordinate)
euclideanCoordinate
- the Euclidean coordinatepublic com.vividsolutions.jts.geom.Coordinate toEuclideanCoordinate(com.vividsolutions.jts.geom.Coordinate simplicialCoordinate)
simplicialCoordinate
- the simplicial coordinate, which uses x, y, and zpublic com.vividsolutions.jts.geom.Envelope getEnvelope()