|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.math3.geometry.euclidean.threed.LineSegment
public final class LineSegment
This is a describing class for a line segment in 3D space, with a method to compute the shortest distance to a line.
Creation with two dimensions, a length and three Vector3D : Vector3D origin = new Vector3D(1.0, 6.0, -2.0); Vector3D direction = new Vector3D(6.0, -3.0, -1.0); double length = 2.0; LineSegment segment = new LineSegment(origin, direction, length); Distance to a line : double distance = segment.distanceTo(line);
Constructor Summary | |
---|---|
LineSegment(Vector3D inOrigin,
Vector3D inDirection,
double inLength)
Build a line segment from its origin, direction and length. |
Method Summary | |
---|---|
Vector3D[] |
closestPointTo(Line line)
Computation of the closest point to a line, and the associated point of the line; |
double |
distanceTo(Line line)
Computes the shortest distance to a line of space. |
Vector3D |
getDirection()
|
Vector3D |
getEnd()
|
double |
getLength()
|
Vector3D |
getOrigin()
|
String |
toString()
Get a representation for this line segment. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LineSegment(Vector3D inOrigin, Vector3D inDirection, double inLength)
inOrigin
- the segment's origininDirection
- the segment's directioninLength
- the segment's lengthMethod Detail |
---|
public Vector3D getOrigin()
public Vector3D getEnd()
public double getLength()
public Vector3D getDirection()
public double distanceTo(Line line)
line
- the line
public Vector3D[] closestPointTo(Line line)
line
- the line
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |