raytracer.internal
Class Point

java.lang.Object
  |
  +--raytracer.internal.Point

public class Point
extends java.lang.Object

A representation of a point in three dimensions


Constructor Summary
Point(float x, float y, float z)
          Creates a point at the location (x,y,z)
Point(Point p)
          Copy constructor
 
Method Summary
 Point add(Vector v)
          Adds a vector to a point
 Vector sub(Point p)
          Subtracts a point from a point
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Point

public Point(float x,
             float y,
             float z)
Creates a point at the location (x,y,z)


Point

public Point(Point p)
Copy constructor

Parameters:
p - Point to duplicate
Method Detail

add

public Point add(Vector v)
Adds a vector to a point

Parameters:
v - Vector to add
Returns:
New point object

sub

public Vector sub(Point p)
Subtracts a point from a point

Parameters:
p - Point to subtract from this
Returns:
The difference vector from this point to p