Class pmr.euclid.Line3
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pmr.euclid.Line3

java.lang.Object
   |
   +----pmr.euclid.Status
           |
           +----pmr.euclid.Line3

public class Line3
extends Status
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.

Author:
(C) P. Murray-Rust, 1996

Constructor Index

 o Line3()
 o Line3(Line3)
copy constructor
 o Line3(Point3, Point3)
make a line from two Point3s
 o Line3(Point3, Vector3)
formed from line components
 o Line3(Vector3, Point3)
other way round!

Method Index

 o containsPoint(Point3)
is a point on a line?
 o equals(Line3)
are two lines identical (coincident and parallel)?
 o getClosestPointTo(Point3)
point on line closest to another point
 o getDistanceFromPoint(Point3)
distance of a point from a line
 o getIntersectionWith(Plane3)
point of intersection of line and plane
 o getPoint()
get point from line (could be any point on line)
 o getVector()
get vector from line
 o isAntiparallelTo(Line3)
are two lines antiparallel
 o isParallelTo(Line3)
are two lines parallel (not antiparallel)
 o main(String[])
tests Line3 routines
 o subtract()
form coincident antiparallel line
 o toString()
 o transform(Transform3)
transform a line

Constructors

 o Line3
  public Line3()
 o Line3
  public Line3(Point3 p,
               Vector3 v)
formed from line components
 o Line3
  public Line3(Vector3 v,
               Point3 p)
other way round!
 o Line3
  public Line3(Point3 p1,
               Point3 p2)
make a line from two Point3s
 o Line3
  public Line3(Line3 l)
copy constructor

Methods

 o equals
  public boolean equals(Line3 l2)
are two lines identical (coincident and parallel)?
 o subtract
  public Line3 subtract()
form coincident antiparallel line
 o getVector
  public Vector3 getVector()
get vector from line
 o getPoint
  public Point3 getPoint()
get point from line (could be any point on line)
 o transform
  public Line3 transform(Transform3 t)
transform a line
 o isParallelTo
  public boolean isParallelTo(Line3 l2)
are two lines parallel (not antiparallel)
 o isAntiparallelTo
  public boolean isAntiparallelTo(Line3 l2)
are two lines antiparallel
 o containsPoint
  public boolean containsPoint(Point3 p)
is a point on a line?
 o getClosestPointTo
  public Point3 getClosestPointTo(Point3 p2)
point on line closest to another point
 o getDistanceFromPoint
  public double getDistanceFromPoint(Point3 p)
distance of a point from a line
 o getIntersectionWith
  public Point3 getIntersectionWith(Plane3 pl)
point of intersection of line and plane
 o toString
  public String toString()
Overrides:
toString in class Object
 o main
  public static void main(String args[])
tests Line3 routines

All Packages  Class Hierarchy  This Package  Previous  Next  Index