|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--jumbo.euclid.Status
|
+--jumbo.euclid.Line3
Line3 - 3-dimensional line class
Line3 represents a 3-dimensional line. It is one of a set of primitives which can be combined to create and manipulate complex 3-dimensional objects. Lines can be transformed with rotation matrices or rotation-translation matrices (Transform3), can be calculated from other primitives or can be used to generate other primitives.
A line is a vector which is located in space. It is described by a unit vector (v) and a point (p) on the line. Any point on the line can be used for p, and p could change during the existence of a calculation without affecting the integrity of the line, e.g. p = {1,1,1}, v = {1,0,0} is the same line as p = {2,1,1}, v = {1,0,0}. However the absolute direction of v IS important, giving the line a direction.
Default is a default Point3 (0.0, 0.0, 0.0) and default Vector3 (0.0, 0.0, 0.0). Operations on this line may lead to Exceptions such as ZeroLengthVector.
| Constructor Summary | |
Line3()
|
|
Line3(Line3 l)
copy constructor |
|
Line3(Point3 p1,
Point3 p2)
make a line from two Point3s |
|
Line3(Point3 p,
Vector3 v)
formed from line components |
|
Line3(Vector3 v,
Point3 p)
other way round! |
|
| Method Summary | |
boolean |
containsPoint(Point3 p)
is a point on a line? |
boolean |
equals(Line3 l2)
are two lines identical (coincident and parallel)? |
Point3 |
getClosestPointTo(Point3 p2)
point on line closest to another point |
double |
getDistanceFromPoint(Point3 p)
distance of a point from a line |
Point3 |
getIntersectionWith(Plane3 pl)
point of intersection of line and plane |
Point3 |
getPoint()
get point from line (could be any point on line) |
Vector3 |
getVector()
get vector from line |
boolean |
isAntiparallelTo(Line3 l2)
are two lines antiparallel |
boolean |
isParallelTo(Line3 l2)
are two lines parallel (not antiparallel) |
static void |
main(java.lang.String[] args)
tests Line3 routines |
Line3 |
subtract()
form coincident antiparallel line |
java.lang.String |
toString()
|
Line3 |
transform(Transform3 t)
transform a line |
| Methods inherited from class jumbo.euclid.Status |
NYI |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public Line3()
public Line3(Point3 p,
Vector3 v)
public Line3(Vector3 v,
Point3 p)
public Line3(Point3 p1,
Point3 p2)
public Line3(Line3 l)
| Method Detail |
public boolean equals(Line3 l2)
public Line3 subtract()
public Vector3 getVector()
public Point3 getPoint()
public Line3 transform(Transform3 t)
public boolean isParallelTo(Line3 l2)
public boolean isAntiparallelTo(Line3 l2)
public boolean containsPoint(Point3 p)
public Point3 getClosestPointTo(Point3 p2)
public double getDistanceFromPoint(Point3 p)
public Point3 getIntersectionWith(Plane3 pl)
public java.lang.String toString()
public static void main(java.lang.String[] args)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||