Rectangular, Shapepublic class LineSegment extends Polytope implements Rectangular
D, embeddedSpace, hyperPlanes, position, vertices| Constructor | Description |
|---|---|
LineSegment(Space embeddedSpace) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
contains(Vector v) |
Returns true if the given vector lies between the ends of the segment, on
the line joining them.
|
Vector |
getEdgeLengths() |
Returns the length of the line segment as the element of a 1D vector.
|
LineSegment[] |
getEdges() |
|
double |
getLength() |
|
Vector[] |
getVertices() |
Returns an array of all vertices of the polytrope.
|
double |
getVolume() |
Returns the (hyper)volume enclosed by the polytope.
|
static void |
main(java.lang.String[] args) |
|
void |
setEdgeLengths(Vector v) |
Sets the length equal to the element of the (presumably 1D) vector.
|
void |
setLength(double newLength) |
Sets the length of the segment to the given value, keeping
its orientation and the position of its midpoint fixed.
|
void |
setVertex1(Vector newVertex1) |
|
void |
setVertex2(Vector newVertex2) |
|
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, waitapplyTranslationRotation, D, getEmbeddedSpace, getPosition, getVertexCount, setPosition, toStringpublic LineSegment(Space embeddedSpace)
public void updateVertices()
PolytopeupdateVertices in class Polytopepublic Vector[] getVertices()
PolytopegetVertices in class Polytopepublic boolean contains(Vector v)
public double getVolume()
Polytopepublic void setVertex1(Vector newVertex1)
public void setVertex2(Vector newVertex2)
public double getLength()
public void setLength(double newLength)
public void setEdgeLengths(Vector v)
setEdgeLengths in interface Rectangularpublic Vector getEdgeLengths()
getEdgeLengths in interface Rectangularpublic LineSegment[] getEdges()
public static void main(java.lang.String[] args)