public final class Lines3D extends Object
Line3D
and LineSubset3D
instances.Modifier and Type | Method and Description |
---|---|
static Line3D |
fromPointAndDirection(Vector3D pt,
Vector3D dir,
Precision.DoubleEquivalence precision)
Create a new line instance from a point and a direction.
|
static Line3D |
fromPoints(Vector3D p1,
Vector3D p2,
Precision.DoubleEquivalence precision)
Create a new line instance from two points that lie on the line.
|
static Ray3D |
rayFromLocation(Line3D line,
double startLocation)
Construct a ray starting at the given 1D location on
line and continuing in the
direction of the line to infinity. |
static Ray3D |
rayFromPoint(Line3D line,
Vector3D startPoint)
Construct a ray starting at the given point and continuing to infinity in the direction
of
line . |
static Ray3D |
rayFromPointAndDirection(Vector3D startPoint,
Vector3D direction,
Precision.DoubleEquivalence precision)
Construct a ray from a start point and a direction.
|
static ReverseRay3D |
reverseRayFromLocation(Line3D line,
double endLocation)
Construct a reverse ray starting at infinity and continuing in the direction of
line
to the given 1D end location. |
static ReverseRay3D |
reverseRayFromPoint(Line3D line,
Vector3D endPoint)
Construct a reverse ray starting at infinity and continuing in the direction of
line
to the given end point. |
static ReverseRay3D |
reverseRayFromPointAndDirection(Vector3D endPoint,
Vector3D lineDirection,
Precision.DoubleEquivalence precision)
Construct a reverse ray from an end point and a line direction.
|
static Segment3D |
segmentFromLocations(Line3D line,
double a,
double b)
Construct a new line segment from a pair of 1D locations on a line.
|
static Segment3D |
segmentFromPoints(Line3D line,
Vector3D a,
Vector3D b)
Construct a new line segment from a line and a pair of points.
|
static Segment3D |
segmentFromPoints(Vector3D startPoint,
Vector3D endPoint,
Precision.DoubleEquivalence precision)
Construct a new line segment from two points.
|
static LineConvexSubset3D |
span(Line3D line)
Create a
LineConvexSubset3D spanning the entire line. |
static LineConvexSubset3D |
subsetFromInterval(Line3D line,
double a,
double b)
Create a line convex subset from a line and a 1D interval on the line.
|
static LineConvexSubset3D |
subsetFromInterval(Line3D line,
Interval interval)
Create a line convex subset from a line and a 1D interval on the line.
|
static LineConvexSubset3D |
subsetFromInterval(Line3D line,
Vector1D a,
Vector1D b)
Create a line convex subset from a line and a 1D interval on the line.
|
public static Line3D fromPoints(Vector3D p1, Vector3D p2, Precision.DoubleEquivalence precision)
p1
- first point on the linep2
- second point on the lineprecision
- floating point precision contextIllegalArgumentException
- if the points lie too close to create a non-zero direction vectorpublic static Line3D fromPointAndDirection(Vector3D pt, Vector3D dir, Precision.DoubleEquivalence precision)
pt
- a point lying on the linedir
- the direction of the lineprecision
- floating point precision contextIllegalArgumentException
- if dir
has zero length, as evaluated by the
given precision contextpublic static Ray3D rayFromPointAndDirection(Vector3D startPoint, Vector3D direction, Precision.DoubleEquivalence precision)
startPoint
- ray start pointdirection
- ray directionprecision
- precision context used for floating point comparisonsIllegalArgumentException
- If direction
has zero length, as evaluated by the
given precision contextfromPointAndDirection(Vector3D, Vector3D, Precision.DoubleEquivalence)
public static Ray3D rayFromPoint(Line3D line, Vector3D startPoint)
line
. The given point is projected onto the line.line
- line for the raystartPoint
- start point for the rayline
IllegalArgumentException
- if any coordinate in startPoint
is NaN or infinitepublic static Ray3D rayFromLocation(Line3D line, double startLocation)
line
and continuing in the
direction of the line to infinity.line
- line for the raystartLocation
- 1D location of the ray start pointline
IllegalArgumentException
- if startLocation
is NaN or infinitepublic static ReverseRay3D reverseRayFromPointAndDirection(Vector3D endPoint, Vector3D lineDirection, Precision.DoubleEquivalence precision)
endPoint
- instance end pointlineDirection
- line directionprecision
- precision context used for floating point comparisonsIllegalArgumentException
- If lineDirection
has zero length, as evaluated by the
given precision contextfromPointAndDirection(Vector3D, Vector3D, Precision.DoubleEquivalence)
public static ReverseRay3D reverseRayFromPoint(Line3D line, Vector3D endPoint)
line
to the given end point. The point is projected onto the line.line
- line for the instanceendPoint
- end point for the instanceendPoint
IllegalArgumentException
- if any coordinate in endPoint
is NaN or infinitepublic static ReverseRay3D reverseRayFromLocation(Line3D line, double endLocation)
line
to the given 1D end location.line
- line for the instanceendLocation
- 1D location of the instance end pointline
to the given 1D end locationIllegalArgumentException
- if endLocation
is NaN or infinitepublic static Segment3D segmentFromPoints(Vector3D startPoint, Vector3D endPoint, Precision.DoubleEquivalence precision)
startPoint
to endPoint
.startPoint
- segment start pointendPoint
- segment end pointprecision
- precision context to use for floating point comparisonsIllegalArgumentException
- If the vector between startPoint
and endPoint
has zero length,
as evaluated by the given precision contextfromPoints(Vector3D, Vector3D, Precision.DoubleEquivalence)
public static Segment3D segmentFromPoints(Line3D line, Vector3D a, Vector3D b)
a
and b
. The points may
be given in any order.line
- line forming the base of the segmenta
- first pointb
- second pointa
and b
on the given lineIllegalArgumentException
- if either point contains NaN or infinite coordinate values)public static Segment3D segmentFromLocations(Line3D line, double a, double b)
line
- line forming the base of the segmenta
- first 1D location on the lineb
- second 1D location on the linea
and b
on
the given lineIllegalArgumentException
- if either of the locations is NaN or infinitepublic static LineConvexSubset3D span(Line3D line)
LineConvexSubset3D
spanning the entire line. In other words, the returned
subset is infinite and contains all points on the given line.line
- the line to spanpublic static LineConvexSubset3D subsetFromInterval(Line3D line, Interval interval)
line
- the line containing the subsetinterval
- 1D interval on the linepublic static LineConvexSubset3D subsetFromInterval(Line3D line, double a, double b)
line
- the line containing the subseta
- first 1D location on the lineb
- second 1D location on the linepublic static LineConvexSubset3D subsetFromInterval(Line3D line, Vector1D a, Vector1D b)
line
- the line containing the subseta
- first 1D point on the line; must not be nullb
- second 1D point on the line; must not be nullCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.