Class Point

java.lang.Object
  extended by Point

public class Point
extends java.lang.Object

Represents a point in three-dimensional coordinates.


Field Summary
static Point ORIGIN
          The origin point, with zero for all coordinates.
 
Method Summary
 Point add(Vector v)
          Returns a copy of this point shifted by the given * vector.
 Point addScaled(double scalar, Vector v)
          Returns a copy of this point shifted by the given vector scaled by the given scalar.
static Point create(double x, double y, double z)
          Constructs a point with the given coordinates.
 double getDistanceTo(Point other)
          Returns the distance between this point and the parameter point.
 double getX()
          Returns the x-coordinate of this point.
 double getY()
          Returns the y-coordinate of this point.
 double getZ()
          Returns the z-coordinate of this point.
 Vector subtract(Point other)
          Returns the vector from the parameter point to this point - ie, one whose components are the difference of this vector's coordinates and the parameter vector's coordinates.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ORIGIN

public static Point ORIGIN
The origin point, with zero for all coordinates.

Method Detail

getX

public double getX()
Returns the x-coordinate of this point.


getY

public double getY()
Returns the y-coordinate of this point.


getZ

public double getZ()
Returns the z-coordinate of this point.


toString

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

getDistanceTo

public double getDistanceTo(Point other)
Returns the distance between this point and the parameter point.


subtract

public Vector subtract(Point other)
Returns the vector from the parameter point to this point - ie, one whose components are the difference of this vector's coordinates and the parameter vector's coordinates.


addScaled

public Point addScaled(double scalar,
                       Vector v)
Returns a copy of this point shifted by the given vector scaled by the given scalar.


add

public Point add(Vector v)
Returns a copy of this point shifted by the given * vector.


create

public static Point create(double x,
                           double y,
                           double z)
Constructs a point with the given coordinates.