jumbo.euclid
Class Plane3

java.lang.Object
  |
  +--jumbo.euclid.Status
        |
        +--jumbo.euclid.Plane3

public class Plane3
extends Status

Plane3 - 3-dimensional plane class

Plane3 represents a 3-dimensional plane. It is one of a set of primitives which can be combined to create and manipulate complex 3-dimensional objects. Planes 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 plane is described by a unit vector (vector) and the perpendicular distance (dist) of the plane from the origin. The absolute direction of the plane (vector) IS important, giving the plane a direction (back and front faces).

The default plane is a Vector of (0.0, 0.0, 0.0) and a distance of 0.0. Operations on this default may lead to Exceptions such as ZeroLengthvector.


Field Summary
protected  double dist
          distance of plane from origin
protected  Vector3 vect
          vector of plane (normalised)
 
Constructor Summary
Plane3()
           
Plane3(double l, double m, double n, double d)
          formed from plane components; vector is normalised
Plane3(Line3 l, Point3 p)
          make a plane from a line and a point not on the line
Plane3(Plane3 pl)
          copy constructor:
Plane3(Point3 p1, Point3 p2, Point3 p3)
          make a plane from three points
Plane3(Vector3 v, double d)
          formed from plane components
 
Method Summary
 Plane3 clone(Plane3 pl)
           
 boolean containsPoint(Point3 p)
          is a point on a plane?
 boolean equals(Plane3 pl2)
          are two planes coincident and parllel
 Angle getAngleMadeWith(Plane3 pl2)
          the angle between 2 planes (as an Angle)
 Point3 getClosestPointTo(Point3 p2)
          point on plane closest to another point
 double getDistance()
          distance from origin
 double getDistanceFromPoint(Point3 p)
          distance of point from plane (will be a signed quantity)
 Point3 getIntersectionWith(Line3 l)
          point of intersection of plane and line
 Line3 getIntersectionWith(Plane3 pl2)
          line as intersection of two planes
 Point3 getIntersectionWith(Plane3 pl2, Plane3 pl3)
          point where three planes intersect
 Vector3 getVector()
          get vector from plane
 boolean isAntiparallelTo(Plane3 pl2)
          are two planes antiparallel
 boolean isParallelTo(Plane3 pl2)
          are two planes parallel (not antiparallel)
static void main(java.lang.String[] args)
          tests Plane3 routines
 void negative()
          reverse direction of plane
 Plane3 subtract()
          form coincident antiparallel plane
 java.lang.String toString()
           
 
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
 

Field Detail

vect

protected Vector3 vect
vector of plane (normalised)

dist

protected double dist
distance of plane from origin
Constructor Detail

Plane3

public Plane3()

Plane3

public Plane3(double l,
              double m,
              double n,
              double d)
formed from plane components; vector is normalised

Plane3

public Plane3(Vector3 v,
              double d)
formed from plane components

Plane3

public Plane3(Plane3 pl)
copy constructor:

Plane3

public Plane3(Point3 p1,
              Point3 p2,
              Point3 p3)
make a plane from three points

Plane3

public Plane3(Line3 l,
              Point3 p)
make a plane from a line and a point not on the line
Method Detail

clone

public Plane3 clone(Plane3 pl)

getVector

public Vector3 getVector()
get vector from plane

getDistance

public double getDistance()
distance from origin

negative

public void negative()
reverse direction of plane

equals

public boolean equals(Plane3 pl2)
are two planes coincident and parllel

subtract

public Plane3 subtract()
form coincident antiparallel plane

getDistanceFromPoint

public double getDistanceFromPoint(Point3 p)
distance of point from plane (will be a signed quantity)

isParallelTo

public boolean isParallelTo(Plane3 pl2)
are two planes parallel (not antiparallel)

isAntiparallelTo

public boolean isAntiparallelTo(Plane3 pl2)
are two planes antiparallel

containsPoint

public boolean containsPoint(Point3 p)
is a point on a plane?

getClosestPointTo

public Point3 getClosestPointTo(Point3 p2)
point on plane closest to another point

getIntersectionWith

public Point3 getIntersectionWith(Line3 l)
point of intersection of plane and line

getIntersectionWith

public Line3 getIntersectionWith(Plane3 pl2)
line as intersection of two planes

getIntersectionWith

public Point3 getIntersectionWith(Plane3 pl2,
                                  Plane3 pl3)
point where three planes intersect

getAngleMadeWith

public Angle getAngleMadeWith(Plane3 pl2)
the angle between 2 planes (as an Angle)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)
tests Plane3 routines