public class TriangleF
extends java.lang.Object
| Constructor and Description |
|---|
TriangleF(float x1,
float y1,
float x2,
float y2,
float x3,
float y3) |
| Modifier and Type | Method and Description |
|---|---|
double |
getArea() |
float[] |
getCentroid() |
double |
getPerimeter() |
float |
getX1() |
float |
getX2() |
float |
getX3() |
float |
getY1() |
float |
getY2() |
float |
getY3() |
boolean |
isEquilateral() |
boolean |
isPointInside(float px,
float py)
Check if a point is inside the triangle.
|
TriangleF |
translate(float x,
float y)
Translate the triangle by the given values.
|
public TriangleF(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
public float getX1()
public float getY1()
public float getX2()
public float getY2()
public float getX3()
public float getY3()
public TriangleF translate(float x, float y)
x - The x value to translatey - The y value to translatepublic double getArea()
public double getPerimeter()
public float[] getCentroid()
public boolean isPointInside(float px,
float py)
px - The x coordinate of the pointpy - The y coordinate of the pointpublic boolean isEquilateral()