Rectangular
, Shape
public 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, wait
applyTranslationRotation, D, getEmbeddedSpace, getPosition, getVertexCount, setPosition, toString
public LineSegment(Space embeddedSpace)
public void updateVertices()
Polytope
updateVertices
in class Polytope
public Vector[] getVertices()
Polytope
getVertices
in class Polytope
public boolean contains(Vector v)
public double getVolume()
Polytope
public 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 Rectangular
public Vector getEdgeLengths()
getEdgeLengths
in interface Rectangular
public LineSegment[] getEdges()
public static void main(java.lang.String[] args)