|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math3.geometry.euclidean.threed.Line
public class Line
The class represent lines in a three dimensional space.
Each oriented line is intrinsically associated with an abscissa which is a coordinate on the line. The point at abscissa 0 is the orthogonal projection of the origin on the line, another equivalent way to express this is to say that it is the point of the line which is closest to the origin. Abscissa increases in the line direction.
Field Summary | |
---|---|
private Vector3D |
direction
Line direction. |
private Vector3D |
zero
Line point closest to the origin. |
Constructor Summary | |
---|---|
Line(Line line)
Copy constructor. |
|
Line(Vector3D p1,
Vector3D p2)
Build a line from two points. |
Method Summary | |
---|---|
Vector3D |
closestPoint(Line line)
Compute the point of the instance closest to another line. |
boolean |
contains(Vector3D p)
Check if the instance contains a point. |
double |
distance(Line line)
Compute the shortest distance between the instance and another line. |
double |
distance(Vector3D p)
Compute the distance between the instance and a point. |
double |
getAbscissa(Vector3D point)
Get the abscissa of a point with respect to the line. |
Vector3D |
getDirection()
Get the normalized direction vector. |
Vector3D |
getOrigin()
Get the line point closest to the origin. |
Vector3D |
intersection(Line line)
Get the intersection point of the instance and another line. |
boolean |
isSimilarTo(Line line)
Check if the instance is similar to another line. |
Vector3D |
pointAt(double abscissa)
Get one point from the line. |
void |
reset(Vector3D p1,
Vector3D p2)
Reset the instance as if built from two points. |
Line |
revert()
Get a line with reversed direction. |
Vector3D |
toSpace(Vector<Euclidean1D> point)
Transform a sub-space point into a space point. |
Vector1D |
toSubSpace(Vector<Euclidean3D> point)
Transform a space point into a sub-space point. |
SubLine |
wholeLine()
Build a sub-line covering the whole line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Vector3D direction
private Vector3D zero
Constructor Detail |
---|
public Line(Vector3D p1, Vector3D p2)
p1
- first point belonging to the line (this can be any point)p2
- second point belonging to the line (this can be any point, different from p1)
MathIllegalArgumentException
- if the points are equalpublic Line(Line line)
The created instance is completely independent from the original instance, it is a deep copy.
line
- line to copyMethod Detail |
---|
public void reset(Vector3D p1, Vector3D p2)
p1
- first point belonging to the line (this can be any point)p2
- second point belonging to the line (this can be any point, different from p1)
MathIllegalArgumentException
- if the points are equalpublic Line revert()
public Vector3D getDirection()
public Vector3D getOrigin()
public double getAbscissa(Vector3D point)
The abscissa is 0 if the projection of the point and the projection of the frame origin on the line are the same point.
point
- point to check
public Vector3D pointAt(double abscissa)
abscissa
- desired abscissa for the point
public Vector1D toSubSpace(Vector<Euclidean3D> point)
toSubSpace
in interface Embedding<Euclidean3D,Euclidean1D>
point
- n-dimension point of the space
getAbscissa(Vector3D)
public Vector3D toSpace(Vector<Euclidean1D> point)
toSpace
in interface Embedding<Euclidean3D,Euclidean1D>
point
- (n-1)-dimension point of the sub-space
pointAt(double)
public boolean isSimilarTo(Line line)
Lines are considered similar if they contain the same points. This does not mean they are equal since they can have opposite directions.
line
- line to which instance should be compared
public boolean contains(Vector3D p)
p
- point to check
public double distance(Vector3D p)
p
- to check
public double distance(Line line)
line
- line to check against the instance
public Vector3D closestPoint(Line line)
line
- line to check against the instance
public Vector3D intersection(Line line)
line
- other line
public SubLine wholeLine()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |