Embedding<Euclidean3D,Euclidean1D>public class Line extends Object implements Embedding<Euclidean3D,Euclidean1D>
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.
| Constructor | Description |
|---|---|
Line(Cartesian3D p1,
Cartesian3D p2,
double tolerance) |
Build a line from two points.
|
Line(Line line) |
Copy constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
Cartesian3D |
closestPoint(Line line) |
Compute the point of the instance closest to another line.
|
boolean |
contains(Cartesian3D p) |
Check if the instance contains a point.
|
double |
distance(Cartesian3D p) |
Compute the distance between the instance and a point.
|
double |
distance(Line line) |
Compute the shortest distance between the instance and another line.
|
double |
getAbscissa(Cartesian3D point) |
Get the abscissa of a point with respect to the line.
|
Cartesian3D |
getDirection() |
Get the normalized direction vector.
|
Cartesian3D |
getOrigin() |
Get the line point closest to the origin.
|
double |
getTolerance() |
Get the tolerance below which points are considered identical.
|
Cartesian3D |
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.
|
Cartesian3D |
pointAt(double abscissa) |
Get one point from the line.
|
void |
reset(Cartesian3D p1,
Cartesian3D p2) |
Reset the instance as if built from two points.
|
Line |
revert() |
Get a line with reversed direction.
|
Cartesian3D |
toSpace(Cartesian1D point) |
Transform a sub-space point into a space point.
|
Cartesian3D |
toSpace(Point<Euclidean1D> point) |
Transform a sub-space point into a space point.
|
Cartesian3D |
toSpace(Vector<Euclidean1D> vector) |
Transform a sub-space point into a space point.
|
Cartesian1D |
toSubSpace(Cartesian3D point) |
Transform a space point into a sub-space point.
|
Cartesian1D |
toSubSpace(Point<Euclidean3D> point) |
Transform a space point into a sub-space point.
|
Cartesian1D |
toSubSpace(Vector<Euclidean3D> vector) |
Transform a space point into a sub-space point.
|
SubLine |
wholeLine() |
Build a sub-line covering the whole line.
|
public Line(Cartesian3D p1, Cartesian3D p2, double tolerance) throws MathIllegalArgumentException
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)tolerance - tolerance below which points are considered identicalMathIllegalArgumentException - 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 copypublic void reset(Cartesian3D p1, Cartesian3D p2) throws MathIllegalArgumentException
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 double getTolerance()
public Line revert()
public Cartesian3D getDirection()
public Cartesian3D getOrigin()
public double getAbscissa(Cartesian3D 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 checkpublic Cartesian3D pointAt(double abscissa)
abscissa - desired abscissa for the pointpublic Cartesian1D toSubSpace(Vector<Euclidean3D> vector)
vector - n-dimension point of the spacepublic Cartesian3D toSpace(Vector<Euclidean1D> vector)
vector - (n-1)-dimension point of the sub-spacepublic Cartesian1D toSubSpace(Point<Euclidean3D> point)
toSubSpace in interface Embedding<Euclidean3D,Euclidean1D>point - n-dimension point of the spacegetAbscissa(Cartesian3D)public Cartesian3D toSpace(Point<Euclidean1D> point)
toSpace in interface Embedding<Euclidean3D,Euclidean1D>point - (n-1)-dimension point of the sub-spacepointAt(double)public Cartesian1D toSubSpace(Cartesian3D point)
point - n-dimension point of the spacepublic Cartesian3D toSpace(Cartesian1D point)
point - (n-1)-dimension point of the sub-spacepublic 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 comparedpublic boolean contains(Cartesian3D p)
p - point to checkpublic double distance(Cartesian3D p)
p - to checkpublic double distance(Line line)
line - line to check against the instancepublic Cartesian3D closestPoint(Line line)
line - line to check against the instancepublic Cartesian3D intersection(Line line)
line - other linepublic SubLine wholeLine()
Copyright © 2003–2017 The Apache Software Foundation. All rights reserved.