Shape
Parallelogram
, PolygonGeneral
, Rectangle
, Square
public abstract class Polygon extends Polytope
Modifier and Type | Field | Description |
---|---|---|
protected LineSegment[] |
edges |
D, embeddedSpace, hyperPlanes, position, vertices
Modifier | Constructor | Description |
---|---|---|
protected |
Polygon(LineSegment[] edges) |
Constructs a polygon using the given edges for its sides.
|
protected |
Polygon(Space embeddedSpace,
int nSides) |
Constructs a polygon with the given number of sides arranged in a closed loop.
|
Modifier and Type | Method | Description |
---|---|---|
abstract double |
getArea() |
|
LineSegment[] |
getEdges() |
Returns all edges defined by the polygon.
|
double |
getPerimeter() |
Returns the sum of the length of the edges of the polygon
|
double |
getVolume() |
Returns the 2-D volume of the polygon, which is its area
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
applyTranslationRotation, contains, D, getEmbeddedSpace, getPosition, getVertexCount, getVertices, setPosition, toString, updateVertices
protected final LineSegment[] edges
protected Polygon(Space embeddedSpace, int nSides)
protected Polygon(LineSegment[] edges)
public LineSegment[] getEdges()
public double getVolume()
public double getPerimeter()
public abstract double getArea()