|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.matrix.Line3d
public class Line3d
Line3d represents a vector description of a line in three dimensions, which is described by a point on the line and a direction vector.
Constructor Summary | |
---|---|
Line3d()
Creates a Line3d and initializes it to the x axis. |
|
Line3d(double[] values)
Creates a Line3d and initialises it to the prescribed values. |
|
Line3d(double dirx,
double diry,
double dirz,
double x,
double y,
double z)
Creates a Line3d and initialises it to the prescribed values. |
|
Line3d(Line3d line3d)
Creates a Line3d and initializes it from an existing Line3d. |
|
Line3d(Vector3d direction,
Point3d point)
Creates an Line3d and sets it to the prescribed values. |
Method Summary | |
---|---|
Point3d |
closestPoint(Line3d line)
Finds the point on THIS line that is closest to the supplied line |
Point3d |
closestPoint(Line3d line,
double epsilon)
Finds the point on THIS line that is closest to the supplied line |
static boolean |
closestPointBetweenLines(Line3d line1,
Line3d line2,
Point3d pnt1,
Point3d pnt2,
double epsilon)
|
static boolean |
closestPointBetweenLines(Vector3d v1,
Point3d p1,
Vector3d v2,
Point3d p2,
Point3d out1,
Point3d out2,
double epsilon)
|
boolean |
contains(Point3d point)
Returns true if supplied point lies exactly on the line |
boolean |
epsilonContains(Point3d point,
double eps)
Returns true if the supplied point lies on this line within a specified tolerance |
boolean |
epsilonEquals(Line3d line3d,
double eps)
Returns true if the elements of this Line3d equal those of another Line3d within a prescribed tolerance epsilon . |
boolean |
equals(Line3d line3d)
Returns true if the elements of this Line3d equal those of another Line3d exactly. |
boolean |
equals(java.lang.Object obj)
Returns true if the supplied object is a Line3d and its elements equal those of this Line3d exactly. |
void |
get(double[] values)
Gets the values associated with this Line3d. |
void |
getDirection(Vector3d d)
Gets the direction vector for the line |
void |
getPoint(Vector3d p)
Gets a point on the line |
Point3d |
project(Point3d point)
Finds the closest point to the supplied Point3d that lies on the line. |
void |
set(double[] values)
Sets this Line3d to the prescribed values. |
void |
set(double dirx,
double diry,
double dirz,
double x,
double y,
double z)
Sets this Line3d to the prescribed values. |
void |
set(Line3d line3d)
Sets this Line3d to the values of another Line3d. |
void |
set(Vector3d direction,
Point3d point)
Sets this Line3d to the prescribed values. |
void |
setDirection(Vector3d d)
|
void |
setPoint(Point3d p)
|
java.lang.String |
toString()
Returns a String representation of this Line3d, consisting of the components of the direction vector followed by those of the point |
java.lang.String |
toString(NumberFormat fmt)
Returns a String representation of this Point3d, consisting of the x, y, and z components of the direction vector, followed by components of the point. |
java.lang.String |
toString(java.lang.String fmtStr)
Returns a String representation of this Point3d, consisting of the x, y, and z components of the direction vector, followed by components of the point. |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Line3d()
public Line3d(double[] values)
values
- Line3d values given as an array. The x, y, and z components of the
direction vector are given by elements 0 through 2, and point is given
by elements 3-5.public Line3d(double dirx, double diry, double dirz, double x, double y, double z)
dirx
- x component of the direction vectordiry
- y component of the direction vectordirz
- z component of the direction vectorx
- x component of the pointy
- y component of the pointz
- z component of the pointpublic Line3d(Vector3d direction, Point3d point)
direction
- direction vectorpoint
- Point on the linepublic Line3d(Line3d line3d)
line3d
- Line3d to supply initial valuesMethod Detail |
---|
public void set(double dirx, double diry, double dirz, double x, double y, double z)
dirx
- x component of direction vectordiry
- y component of direction vectordirz
- z component of direction vectorx
- x component of pointy
- y component of pointz
- z component of pointpublic void set(double[] values)
values
- Line3d values given as an array. The x, y, and z components of the
direction vector are given by elements 0 through 2, and the position
components by elements 3 through 5public void set(Vector3d direction, Point3d point)
direction
- direction vectorpoint
- point on the linepublic void set(Line3d line3d)
line3d
- Line3d supplying new valuespublic void get(double[] values)
values
- returns the Line3d values. The x, y, and z components of the direction
vector are given by elements 0 through 2, and the components of the point
on the line are given by elements 3 through 5public 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 Point3d project(Point3d point)
point
- The Point3d to project
public boolean epsilonContains(Point3d point, double eps)
point
- Point to test if is on the lineeps
- Tolerance distance
public boolean contains(Point3d point)
point
- Point3d to test
public boolean epsilonEquals(Line3d line3d, double eps) throws ImproperSizeException
epsilon
.
line3d
- Line3d to compare witheps
- comparison tolerance
ImproperSizeException
public boolean equals(Line3d line3d)
line3d
- Line3d to compare with
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Object to compare with
public void getDirection(Vector3d d)
d
- Filled by the values of the direction vectorpublic void getPoint(Vector3d p)
p
- Filled by values of a point on the linepublic void setDirection(Vector3d d)
public void setPoint(Point3d p)
public Point3d closestPoint(Line3d line, double epsilon)
line
- The Line3d to which we search for the closest pointepsilon
- Tolerance for which lines are considered parallel
public static boolean closestPointBetweenLines(Line3d line1, Line3d line2, Point3d pnt1, Point3d pnt2, double epsilon)
public static boolean closestPointBetweenLines(Vector3d v1, Point3d p1, Vector3d v2, Point3d p2, Point3d out1, Point3d out2, double epsilon)
public Point3d closestPoint(Line3d line)
line
- The Line3d to which we search for the closest point
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |