Modifier and Type | Class and Description |
---|---|
static class |
Line3D.SubspaceTransform
Class containing a transformed line instance along with a subspace (1D) transform.
|
Modifier and Type | Method and Description |
---|---|
double |
abscissa(Vector3D pt)
Get the abscissa of the given point on the line.
|
Vector3D |
closest(Line3D line)
Compute the point of the instance closest to another line.
|
boolean |
contains(Vector3D pt)
Check if the instance contains a point.
|
double |
distance(Line3D line)
Compute the shortest distance between the instance and another line.
|
double |
distance(Vector3D pt)
Compute the distance between the instance and a point.
|
boolean |
eq(Line3D other,
Precision.DoubleEquivalence ctx)
Return true if this instance should be considered equivalent to the argument, using the
given precision context for comparison.
|
boolean |
equals(Object obj) |
Vector3D |
getDirection()
Get the normalized direction vector.
|
Vector3D |
getOrigin()
Get the line point closest to the origin.
|
Precision.DoubleEquivalence |
getPrecision()
Get the object used to determine floating point equality for this instance.
|
int |
hashCode() |
Vector3D |
intersection(Line3D line)
Get the intersection point of the instance and another line.
|
boolean |
isSimilarTo(Line3D line)
Check if the instance is similar to another line.
|
Vector3D |
pointAt(double abscissa)
Get one point from the line.
|
Ray3D |
rayFrom(double startLocation)
Create a new ray instance that starts at the given 1D location and continues in
the direction of the line to infinity.
|
Ray3D |
rayFrom(Vector3D startPoint)
Create a new ray instance that starts at the projection of the given point
and continues in the direction of the line to infinity.
|
Line3D |
reverse()
Return a line containing the same points as this instance but pointing
in the opposite direction.
|
ReverseRay3D |
reverseRayTo(double endLocation)
Create a new line convex subset that starts at infinity and continues along
the line up to the given 1D location.
|
ReverseRay3D |
reverseRayTo(Vector3D endPoint)
Create a new line convex subset that starts at infinity and continues along
the line up to the projection of the given end point.
|
Segment3D |
segment(double a,
double b)
Create a new line segment from the given 1D interval.
|
Segment3D |
segment(Vector3D a,
Vector3D b)
Create a new line segment from two points.
|
LineConvexSubset3D |
span()
Return a new infinite line subset representing the entire line.
|
Line3D.SubspaceTransform |
subspaceTransform(Transform<Vector3D> transform)
Get an object containing the current line transformed by the argument along with a
1D transform that can be applied to subspace points.
|
Vector3D |
toSpace(double abscissa)
Get the 3 dimensional point at the given abscissa position
on the line.
|
Vector3D |
toSpace(Vector1D pt) |
String |
toString() |
Vector1D |
toSubspace(Vector3D pt) |
Line3D |
transform(Transform<Vector3D> transform)
Transform this instance.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
toSpace, toSubspace
public Vector3D getOrigin()
public Vector3D getDirection()
public Precision.DoubleEquivalence getPrecision()
public Line3D reverse()
public Line3D transform(Transform<Vector3D> transform)
transform
- object used to transform the instancepublic Line3D.SubspaceTransform subspaceTransform(Transform<Vector3D> transform)
SubspaceTransform st = line.subspaceTransform(transform); Vector1D subPt = Vector1D.of(1); Vector3D a = transform.apply(line.toSpace(subPt)); // transform in 3D space Vector3D b = st.getLine().toSpace(st.getTransform().apply(subPt)); // transform in 1D spaceAt the end of execution, the points
a
(which was transformed using the original
3D transform) and b
(which was transformed in 1D using the subspace transform)
are equivalent.transform
- the transform to apply to this instancetransform(Transform)
public double abscissa(Vector3D pt)
toSubspace(Vector3D)
except that this method
returns a double instead of a Vector1D
.pt
- point to compute the abscissa fortoSubspace(Vector3D)
public Vector3D pointAt(double abscissa)
abscissa
- desired abscissa for the pointpublic Vector1D toSubspace(Vector3D pt)
toSubspace
in interface Embedding<Vector3D,Vector1D>
public Vector3D toSpace(double abscissa)
abscissa
- location on the linepublic boolean isSimilarTo(Line3D 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(Vector3D pt)
pt
- point to checkpublic double distance(Vector3D pt)
pt
- to checkpublic double distance(Line3D line)
line
- line to check against the instancepublic Vector3D closest(Line3D line)
line
- line to check against the instancepublic Vector3D intersection(Line3D line)
line
- other linepublic LineConvexSubset3D span()
Lines3D.span(Line3D)
public Segment3D segment(double a, double b)
a
- first 1D location for the intervalb
- second 1D location for the intervalIllegalArgumentException
- if either of the locations is NaN or infiniteLines3D.segmentFromLocations(Line3D, double, double)
public Segment3D segment(Vector3D a, Vector3D b)
a
and b
. The points may be given in any order.a
- first pointb
- second pointIllegalArgumentException
- if either point contains NaN or infinite coordinate valuesLines3D.segmentFromPoints(Line3D, Vector3D, Vector3D)
public ReverseRay3D reverseRayTo(Vector3D endPoint)
endPoint
- point defining the end point of the line subset; the end point
is equal to the projection of this point onto the lineIllegalArgumentException
- if any coordinate in endPoint
is NaN or infiniteLines3D.reverseRayFromPoint(Line3D, Vector3D)
public ReverseRay3D reverseRayTo(double endLocation)
endLocation
- the 1D location of the end of the half-lineIllegalArgumentException
- if endLocation
is NaN or infiniteLines3D.reverseRayFromLocation(Line3D, double)
public Ray3D rayFrom(Vector3D startPoint)
startPoint
- point defining the start point of the ray; the start point
is equal to the projection of this point onto the lineIllegalArgumentException
- if any coordinate in startPoint
is NaN or infiniteLines3D.rayFromPoint(Line3D, Vector3D)
public Ray3D rayFrom(double startLocation)
startLocation
- 1D location defining the start point of the rayIllegalArgumentException
- if startLocation
is NaN or infiniteLines3D.rayFromLocation(Line3D, double)
public boolean eq(Line3D other, Precision.DoubleEquivalence ctx)
origin
s and direction
s.other
- the point to compare withctx
- precision context to use for the comparisonVector3D.eq(Vector3D, Precision.DoubleEquivalence)
Copyright © 2016–2021 The Apache Software Foundation. All rights reserved.