|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.matrix.Line
public class Line
Implements a line of 3-space, characterized by a point p and a direction u. This representation is redundant, since a line has only four degrees of freedom. However, the point-direction representation is convenient for parametrically expressing points along the line, as
x = p + u s
Constructor Summary | |
---|---|
Line()
|
|
Line(double px,
double py,
double pz,
double ux,
double uy,
double uz)
|
|
Line(Line line)
|
|
Line(Point3d p,
Vector3d u)
|
Method Summary | |
---|---|
double |
distance(Line line)
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Line()
public Line(Point3d p, Vector3d u)
public Line(Line line)
public Line(double px, double py, double pz, double ux, double uy, double uz)
Method Detail |
---|
public void set(Point3d p, Vector3d u)
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 setPoints(Point3d p0, Point3d p1)
public void setDirection(Vector3d u)
public void setDirection(double x, double y, double z)
public void getPluecker(Vector3d u, Vector3d v)
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 to
public double distance(Line line)
line
- line to find distance to
public double nearestPoint(Point3d pr, Vector3d p1)
pr
- returns nearest point valuep1
- point to find nearest point to
public double nearestPoint(Point3d p, Line line)
p
- returns the nearest point valueline
- line to find nearest point to
public double intersectPlane(Point3d p, Plane plane)
p
- returns the intersection pointplane
- plane to intersect with
public 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 specification
public 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 format
public 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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |