Shapepublic class Cube extends Hexahedron
edges, facesD, embeddedSpace, hyperPlanes, position, vertices| Constructor | Description |
|---|---|
Cube(Space embeddedSpace) |
Constructs a cube of unit size.
|
Cube(Space embeddedSpace,
double size) |
Constructs a cube with edge length having the given value.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
contains(Vector v) |
Returns
true if the given vector lies inside (or on the surface of)
this cell, false otherwise. |
double |
getEdgeLength() |
|
double |
getPerimeter() |
Returns 12*edgeLength
|
double |
getSurfaceArea() |
Returns 6*edgeLength^2
|
double |
getVolume() |
Returns edgeLength^3.
|
void |
setEdgeLength(double edgeLength) |
|
void |
updateVertices() |
This method should be defined by the subclass to calculate the vertices
in accordance with the internal representation of the polytope.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdistanceTo, getEdges, getFacesapplyTranslationRotation, D, getEmbeddedSpace, getPosition, getVertexCount, getVertices, setPosition, toStringpublic Cube(Space embeddedSpace)
public Cube(Space embeddedSpace, double size)
size - edge length of the cubepublic double getVolume()
public double getSurfaceArea()
getSurfaceArea in class Polyhedronpublic double getPerimeter()
getPerimeter in class Polyhedronpublic boolean contains(Vector v)
true if the given vector lies inside (or on the surface of)
this cell, false otherwise.public double getEdgeLength()
public void setEdgeLength(double edgeLength)
edgeLength - The size to set.public void updateVertices()
PolytopeupdateVertices in class Polytope