|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttoxi.geom.Triangle2D
public class Triangle2D
Field Summary | |
---|---|
Vec2D |
a
|
Vec2D |
b
|
Vec2D |
c
|
Vec2D |
centroid
|
Constructor Summary | |
---|---|
Triangle2D()
|
|
Triangle2D(ReadonlyVec2D a,
ReadonlyVec2D b,
ReadonlyVec2D c)
|
Method Summary | |
---|---|
Triangle2D |
adjustTriangleSizeBy(float offset)
|
Triangle2D |
adjustTriangleSizeBy(float offAB,
float offBC,
float offCA)
|
Vec2D |
computeCentroid()
|
boolean |
containsPoint(ReadonlyVec2D p)
Checks if point vector is inside the triangle created by the points a, b and c. |
Triangle2D |
copy()
|
static Triangle2D |
createEquilateralFrom(ReadonlyVec2D a,
ReadonlyVec2D b)
|
Triangle2D |
flipVertexOrder()
|
Vec2D |
fromBarycentric(ReadonlyVec3D p)
|
float |
getArea()
Computes the area of the shape. |
Rect |
getBounds()
|
Circle |
getCircumCircle()
|
float |
getCircumference()
Computes the shape's circumference. |
Vec2D |
getClosestPointTo(ReadonlyVec2D p)
Finds and returns the closest point on any of the triangle edges to the point given. |
boolean |
intersectsTriangle(Triangle2D tri)
|
boolean |
isClockwise()
|
static boolean |
isClockwise(Vec2D a,
Vec2D b,
Vec2D c)
|
void |
set(Vec2D a2,
Vec2D b2,
Vec2D c2)
|
Polygon2D |
toPolygon2D()
Creates a Polygon2D instance of the triangle. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Vec2D a
public Vec2D b
public Vec2D c
public Vec2D centroid
Constructor Detail |
---|
public Triangle2D()
public Triangle2D(ReadonlyVec2D a, ReadonlyVec2D b, ReadonlyVec2D c)
Method Detail |
---|
public static Triangle2D createEquilateralFrom(ReadonlyVec2D a, ReadonlyVec2D b)
public static boolean isClockwise(Vec2D a, Vec2D b, Vec2D c)
public Triangle2D adjustTriangleSizeBy(float offset)
public Triangle2D adjustTriangleSizeBy(float offAB, float offBC, float offCA)
public Vec2D computeCentroid()
public boolean containsPoint(ReadonlyVec2D p)
containsPoint
in interface Shape2D
public Triangle2D copy()
public Triangle2D flipVertexOrder()
public Vec2D fromBarycentric(ReadonlyVec3D p)
public float getArea()
Shape2D
getArea
in interface Shape2D
public Rect getBounds()
public Circle getCircumCircle()
public float getCircumference()
Shape2D
getCircumference
in interface Shape2D
public Vec2D getClosestPointTo(ReadonlyVec2D p)
p
- point to check
public boolean intersectsTriangle(Triangle2D tri)
public boolean isClockwise()
public void set(Vec2D a2, Vec2D b2, Vec2D c2)
public Polygon2D toPolygon2D()
Polygon2D
instance of the triangle. The vertices of
this polygon are disconnected from the ones defining this triangle.
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |