public class Line extends Object implements Embedding<Euclidean3D,Euclidean1D>, Serializable
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.
This PATRIUS 4.9, the user can define a "min abscissa" in order to define a sub-line: only points after this abscissa are considered to be part of the sub-line.
Constructor and Description |
---|
Line(Line line)
Copy constructor.
|
Line(Vector3D p1,
Vector3D p2)
Build a line from two points.
|
Line(Vector3D p1,
Vector3D p2,
Vector3D pMinAbscissa)
Build a line from three points, one of which is the point of minimum abscissa.
|
Modifier and Type | Method and Description |
---|---|
Vector3D |
closestPoint(Line line)
Compute the point of the instance closest to another line.
|
Vector3D[] |
closestPointTo(Line line)
Computes the points of this and another line realizing the shortest distance.
|
boolean |
contains(Vector3D p)
Check if the instance contains a point.
|
static Line |
createLine(Vector3D point,
Vector3D direction)
Creates a Line object from a point of space and a direction vector.
|
static Line |
createLine(Vector3D point,
Vector3D direction,
Vector3D pointMinAbscissa)
Creates a Line object from a point of space, a direction vector and the point of minimum abscissa.
|
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[] |
getIntersectionPoints(Line line)
Compute the intersection points with another line if it exists.
|
double |
getMinAbscissa()
Get the line minimum abscissa.
|
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.
|
Vector3D |
pointOfMinAbscissa(Vector3D[] points)
Get the point with the lowest abscissa from an array of points.
|
void |
reset(Vector3D p1,
Vector3D p2)
Reset the instance as if built from two points.
|
Line |
revert()
Get a line with reversed direction.
In the case of a semi-finite line, the min abscissa point is "frozen" so that the min abscissa point of the new line is the same. |
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.
|
public Line(Vector3D p1, Vector3D p2, Vector3D pMinAbscissa)
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)pMinAbscissa
- point of minimum abscissa (only points after this abscissa are considered to be part of the sub-line)MathIllegalArgumentException
- if the points are equalpublic 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 copypublic 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 getMinAbscissa()
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 checkpublic Vector3D pointAt(double abscissa)
abscissa
- desired abscissa for the pointpublic Vector1D toSubSpace(Vector<Euclidean3D> point)
toSubSpace
in interface Embedding<Euclidean3D,Euclidean1D>
point
- n-dimension point of the spacegetAbscissa(Vector3D)
public Vector3D toSpace(Vector<Euclidean1D> point)
toSpace
in interface Embedding<Euclidean3D,Euclidean1D>
point
- (n-1)-dimension point of the sub-spacepointAt(double)
public boolean isSimilarTo(Line line)
Lines are considered similar if they contain the same points regardless abscissas and if they are both infinite or semi-finite. This does not mean they are equal since they can also have opposite directions.
line
- line to which instance should be comparedpublic boolean contains(Vector3D p)
p
- point to checkpublic double distance(Vector3D p)
p
- to checkpublic double distance(Line line)
line
- line to check against the instancepublic Vector3D closestPoint(Line line)
line
- line to check against the instancepublic Vector3D intersection(Line line)
line
- other linepublic SubLine wholeLine()
public Vector3D[] getIntersectionPoints(Line line)
line
- the second linepublic final Vector3D[] closestPointTo(Line line)
line
- the linepublic final Vector3D pointOfMinAbscissa(Vector3D[] points)
points
- array of points to assess, must not be emptypublic static final Line createLine(Vector3D point, Vector3D direction)
point
- the origin pointdirection
- the directing vector of the linepublic static final Line createLine(Vector3D point, Vector3D direction, Vector3D pointMinAbscissa)
point
- the origin pointdirection
- the directing vector of the linepointMinAbscissa
- point of minimum abscissa (only points after this abscissa are considered to be part of the sub-line)Copyright © 2023 CNES. All rights reserved.