NASA World Wind

gov.nasa.worldwind.geom
Class Plane

java.lang.Object
  extended by gov.nasa.worldwind.geom.Plane

public final class Plane
extends Object

A Plane object represents a mathematical plane in an arbitrary cartesian co-ordinate system. A Plane is defined by a normal vector and a distance along that vector from the origin, where the distance represents the distance from the origin to the Plane rather than from the Plane to the origin.

Instances of Plane are immutable.


Constructor Summary
Plane(double a, double b, double c, double d)
          Obtains a new Plane whose normal is defined by the vector (a,b,c) and whose disance from that vector is d.
Plane(Point vec)
          Obtains a new instance of a Plane whose information is contained in Vector vec.
 
Method Summary
 double dot(Point p)
          Calculates the dot product of this Plane with Point p.
 boolean equals(Object o)
           
 double getDistance()
          Retrieves the distance from the origin to this Plane.
 Point getNormal()
          Retrieves a Point representing the normal to this Plane.
 Point getVector()
          Retrieves a vector representing the normal and distance to this Plane.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Plane

public Plane(double a,
             double b,
             double c,
             double d)
Obtains a new Plane whose normal is defined by the vector (a,b,c) and whose disance from that vector is d. The vector may not have zero length.

Parameters:
a - the x-parameter of the normal to this Plane
b - the y-parameter of the normal to this Plane
c - the z-parameter of the normal to this Plane
d - the distance of this Plane from the origin along its normal.
Throws:
IllegalArgumentException - if 0==a==b==c

Plane

public Plane(Point vec)
Obtains a new instance of a Plane whose information is contained in Vector vec.

Parameters:
vec - the Vector containing information about this Plane's normal and distance
Throws:
IllegalArgumentException - if passed a null or zero-length Vector
Method Detail

dot

public final double dot(Point p)
Calculates the dot product of this Plane with Point p.

Parameters:
p - the Point to dot with this Plane
Returns:
the dot product of p and this Plane
Throws:
IllegalArgumentException - if p is null

equals

public final boolean equals(Object o)
Overrides:
equals in class Object

getDistance

public final double getDistance()
Retrieves the distance from the origin to this Plane. Two options exist for defining distance - the first represents the distance from the origin to the Plane, the second represents the distance from the Plane to the origin. This function uses the first method. The outcome of this is that depending on the caller's view of this method, the sign of distances may appear to be reversed.

Returns:
the distance between this Plane and the origin

getNormal

public final Point getNormal()
Retrieves a Point representing the normal to this Plane.

Returns:
a Point representing the normal to this Plane

getVector

public final Point getVector()
Retrieves a vector representing the normal and distance to this Plane. The vector has the structure (x, y, z, distance), where (x, y, z) represents the normal, and distance represents the distance from the origin.

Returns:
a Vector representation of this Plane

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

toString

public final String toString()
Overrides:
toString in class Object

NASA World Wind