public class Line
extends java.lang.Object
x = p + u s
Constructor and Description |
---|
Line() |
Line(double px,
double py,
double pz,
double ux,
double uy,
double uz) |
Line(Line line) |
Line(Point3d p,
Vector3d u) |
Modifier and Type | Method and Description |
---|---|
double |
distance(Line line)
Returns the perpendicular distance of this line to another line.
|
double |
distance(Line line,
Point3d point,
Point3d nearPoint)
Returns the perpendicular distance of this line to another line.
|
double |
distance(Point3d p1)
Returns the perpendicular distance of this line to a point
|
Vector3d |
getDirection() |
Point3d |
getOrigin() |
void |
getPluecker(Vector3d u,
Vector3d v) |
double |
intersectPlane(Point3d p,
Plane plane)
Finds the intersection of this line with a plane.
|
void |
inverseTransform(AffineTransform3dBase X)
Applies an inverse affine transformation to this line, in place.
|
void |
inverseTransform(AffineTransform3dBase X,
Line line)
Applies an inverse affine transformation to a specified line and places
the result in this line.
|
double |
nearestPoint(Point3d p,
Line line)
Finds the nearest point on this line to another line.
|
double |
nearestPoint(Point3d pr,
Vector3d p1)
Returns the nearest point on this line to another point.
|
void |
scan(ReaderTokenizer rtok)
Sets this line to values read from a ReaderTokenizer.
|
void |
set(double px,
double py,
double pz,
double ux,
double uy,
double uz) |
void |
set(Line line) |
void |
set(Point3d p,
Vector3d u) |
void |
setDirection(double x,
double y,
double z) |
void |
setDirection(Vector3d u) |
void |
setOrigin(double x,
double y,
double z) |
void |
setOrigin(Point3d p) |
void |
setPoints(Point3d p0,
Point3d p1) |
java.lang.String |
toString()
Returns a String representation of this Line, consisting of the x, y, and
z coordinates of the origin, followed by the coordinates of the direction.
|
java.lang.String |
toString(NumberFormat fmt)
Returns a String representation of this Line, consisting of the x, y, and
z coordinates of the origin, followed by the coordinates of the direction.
|
java.lang.String |
toString(java.lang.String fmtStr)
Returns a String representation of this Line, consisting of the x, y, and
z coordinates of the origin, followed by the coordinates of the direction.
|
void |
transform(AffineTransform3dBase X)
Applies an affine transformation to this line, in place.
|
void |
transform(AffineTransform3dBase X,
Line line)
Applies an affine transformation to a specified line and places the result
in this line.
|
public Line()
public Line(Line line)
public Line(double px, double py, double pz, double ux, double uy, double uz)
public void set(double px, double py, double pz, double ux, double uy, double uz)
public void set(Line line)
public Point3d getOrigin()
public Vector3d getDirection()
public void setOrigin(Point3d p)
public void setOrigin(double x, double y, double z)
public void setDirection(Vector3d u)
public void setDirection(double x, double y, double z)
public void transform(AffineTransform3dBase X)
X
- affine transformationpublic void inverseTransform(AffineTransform3dBase X)
X
- affine transformationpublic void transform(AffineTransform3dBase X, Line line)
X
- affine transformationline
- line to transformpublic void inverseTransform(AffineTransform3dBase X, Line line)
X
- affine transformationline
- line to transformpublic double distance(Point3d p1)
p1
- point to find distance topublic double distance(Line line)
line
- line to find distance topublic double distance(Line line, Point3d point, Point3d nearPoint)
line
- line to find distance topoint
- point on the current line nearest to the provided linenearPoint
- point on line nearest to thispublic double nearestPoint(Point3d pr, Vector3d p1)
pr
- returns nearest point valuep1
- point to find nearest point topublic double nearestPoint(Point3d p, Line line)
p
- returns the nearest point valueline
- line to find nearest point topublic double intersectPlane(Point3d p, Plane plane)
p
- returns the intersection pointplane
- plane to intersect withpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String fmtStr)
printf
style format
string. For a description of the format string syntax, see
NumberFormat
.fmtStr
- numeric format specificationpublic java.lang.String toString(NumberFormat fmt)
printf
style as
decribed by the parameter NumberFormat
. When called
numerous times, this routine can be more efficient than
toString(String)
, because the NumberFormat
does not need to be recreated each
time from a specification string.fmt
- numeric formatpublic void scan(ReaderTokenizer rtok) throws java.io.IOException
[ ]
. These
numbers give the coordinates of the line origin and direction,
repsectively.rtok
- Tokenizer from which line values are read. Number parsing should be
enabled.java.io.IOException
- if an I/O or formatting error is encountered