public class Triangle2D
extends java.lang.Object
Constructor and Description |
---|
Triangle2D(Vector2D a,
Vector2D b,
Vector2D c)
Constructor of the 2D triangle class used to create a new triangle
instance from three 2D vectors describing the triangle's vertices.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Vector2D point)
Tests if a 2D point lies inside this 2D triangle.
|
EdgeDistancePack |
findNearestEdge(Vector2D point)
Returns an EdgeDistancePack containing the edge and its distance nearest
to the specified point.
|
Vector2D |
getNoneEdgeVertex(Edge2D edge)
Returns the vertex of this triangle that is not part of the given edge.
|
boolean |
hasVertex(Vector2D vertex)
Returns true if the given vertex is one of the vertices describing this
triangle.
|
boolean |
isNeighbour(Edge2D edge)
Returns true if this triangle contains the given edge.
|
boolean |
isOrientedCCW()
Test if this triangle is oriented counterclockwise (CCW).
|
boolean |
isPointInCircumcircle(Vector2D point)
Tests if a given point lies in the circumcircle of this triangle.
|
java.lang.String |
toString() |
public Triangle2D(Vector2D a, Vector2D b, Vector2D c)
a
- The first vertex of the triangleb
- The second vertex of the trianglec
- The third vertex of the trianglepublic boolean contains(Vector2D point)
point
- The point to be testedpublic boolean isPointInCircumcircle(Vector2D point)
point
- The point to be testedpublic boolean isOrientedCCW()
public boolean isNeighbour(Edge2D edge)
edge
- The edge to be testedpublic Vector2D getNoneEdgeVertex(Edge2D edge)
edge
- The edgepublic boolean hasVertex(Vector2D vertex)
vertex
- The vertex to be testedpublic EdgeDistancePack findNearestEdge(Vector2D point)
point
- The point the nearest edge is queried forpublic java.lang.String toString()
toString
in class java.lang.Object