Shape
public class Square extends Polygon
D, embeddedSpace, hyperPlanes, position, vertices
Constructor | Description |
---|---|
Square(Space embeddedSpace) |
Constructs a square of unit size.
|
Square(Space embeddedSpace,
double size) |
Constructs a square 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 |
getArea() |
Returns edgeLength^2.
|
double |
getEdgeLength() |
|
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, wait
getEdges, getPerimeter, getVolume
applyTranslationRotation, D, getEmbeddedSpace, getPosition, getVertexCount, getVertices, setPosition, toString
public Square(Space embeddedSpace)
public Square(Space embeddedSpace, double size)
size
- edge length of the cubepublic 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 new length of the sides of the squarepublic void updateVertices()
Polytope
updateVertices
in class Polytope