public class Distance extends Object
Constructor and Description |
---|
Distance() |
Modifier and Type | Method and Description |
---|---|
static double |
pointToRay(Point3d pt,
Point3d rayorig,
Vector3d raydir)
Minimum pt to ray distance.
|
static double |
pointToRay(Point3d pt,
Point3d rayorig,
Vector3d raydir,
Point3d rayint,
double[] param)
Minimum pt to ray distance.
|
static double |
pointToSegment(Point3d pt,
Point3d segstart,
Point3d segend)
Minimum pt to segment distance.
|
static double |
pointToSegment(Point3d pt,
Point3d segstart,
Point3d segend,
Point3d segint,
double[] param)
Minimum pt to segment distance.
|
static double |
rayToRay(Point3d ray0orig,
Vector3d ray0dir,
Point3d ray1orig,
Vector3d ray1dir)
Minimum ray to ray distance.
|
static double |
rayToRay(Point3d ray0orig,
Vector3d ray0dir,
Point3d ray1orig,
Vector3d ray1dir,
Point3d ray0int,
Point3d ray1int,
double[] param)
Minimum ray to ray distance.
|
static double |
rayToSegment(Point3d rayorig,
Vector3d raydir,
Point3d segstart,
Point3d segend)
Minimum ray to segment distance.
|
static double |
rayToSegment(Point3d rayorig,
Vector3d raydir,
Point3d segstart,
Point3d segend,
Point3d rayint,
Point3d segint,
double[] param)
Minimum ray to segment distance.
|
static double |
segmentToSegment(Point3d seg0start,
Point3d seg0end,
Point3d seg1start,
Point3d seg1end)
Minimum segment to segment distance.
|
static double |
segmentToSegment(Point3d seg0start,
Point3d seg0end,
Point3d seg1start,
Point3d seg1end,
Point3d seg0int,
Point3d seg1int,
double[] param)
Minimum segment to segment distance.
|
public static double rayToSegment(Point3d rayorig, Vector3d raydir, Point3d segstart, Point3d segend)
rayorig
- Origin of the rayraydir
- Direction of the raysegstart
- Segment start pointsegend
- Segment end pointpublic static double rayToSegment(Point3d rayorig, Vector3d raydir, Point3d segstart, Point3d segend, Point3d rayint, Point3d segint, double[] param)
rayorig
- Origin of the rayraydir
- Direction of the raysegstart
- Segment start pointsegend
- Segment end pointrayint
- If non-null, will be filled with the coordinates of
the point corresponding to the minimum distance on the ray.segint
- If non-null, will be filled with the coordinates of
the point corresponding to the minimum distance on the segment.param
- An array of two doubles, will be filled with the
parametric factors used to find the point of shortest distance on
each primitive (ray = O +sD, with O=origin and
D=direction). param[0] will contain the parameter for the ray,
and param[1] the parameter for the segment.public static double rayToRay(Point3d ray0orig, Vector3d ray0dir, Point3d ray1orig, Vector3d ray1dir)
ray0orig
- Origin of ray 0ray0dir
- Direction of ray 0ray1orig
- Origin of ray 1ray1dir
- Direction of ray 1public static double rayToRay(Point3d ray0orig, Vector3d ray0dir, Point3d ray1orig, Vector3d ray1dir, Point3d ray0int, Point3d ray1int, double[] param)
ray0orig
- Origin of ray 0ray0dir
- Direction of ray 0ray1orig
- Origin of ray 1ray1dir
- Direction of ray 1ray0int
- If non-null, will be filled with the coordinates
of the point corresponding to the minimum distance on ray 0.ray1int
- If non-null, will be filled with the coordinates
of the point corresponding to the minimum distance on ray 1.param
- An array of two doubles, will be filled with the
parametric factors used to find the point of shortest distance on
each primitive (ray = O +sD, with O=origin and
D=direction). param[0] will contain the parameter for ray0, and
param[1] the parameter for ray1.public static double pointToRay(Point3d pt, Point3d rayorig, Vector3d raydir)
pt
- The pointrayorig
- Origin of the rayraydir
- Direction of the raypublic static double pointToRay(Point3d pt, Point3d rayorig, Vector3d raydir, Point3d rayint, double[] param)
pt
- The pointrayorig
- Origin of the rayraydir
- Direction of the rayrayint
- If non-null, will be filled with the coordinates of
the point corresponding to the minimum distance on the ray.param
- An array of one double, will be filled with the
parametric factors used to find the point of shortest distance on
the ray (ray = O +sD, with O=origin and D=direction). param[0]
will contain the parameter for the ray.public static double pointToSegment(Point3d pt, Point3d segstart, Point3d segend)
public static double pointToSegment(Point3d pt, Point3d segstart, Point3d segend, Point3d segint, double[] param)
public static double segmentToSegment(Point3d seg0start, Point3d seg0end, Point3d seg1start, Point3d seg1end)
seg0start
- the start of segment 0seg0end
- the end of segment 0seg1start
- the start of segment 1seg1end
- the end of segment 1public static double segmentToSegment(Point3d seg0start, Point3d seg0end, Point3d seg1start, Point3d seg1end, Point3d seg0int, Point3d seg1int, double[] param)
seg0start
- the start of segment 0seg0end
- the end of segment 0seg1start
- the start of segment 1seg1end
- the end of segment 1seg0int
- If non-null, will be filled with the coordinates
of the point corresponding to the minimum distance on segment 0.seg1int
- If non-null, will be filled with the coordinates
of the point corresponding to the minimum distance on segment 1.param
- An array of two doubles, will be filled with the
parametric factors used to find the point of shortest distance on
each primitive (segment = O +sD, with O=origin and
D=direction). param[0] will contain the parameter for segment 0,
and param[1] the parameter for segment 1.Copyright © 2016–2022 SciJava. All rights reserved.