raja
Class Ray

java.lang.Object
  |
  +--raja.Ray
Direct Known Subclasses:
LightRay

public class Ray
extends Object

The Ray class defines a high precision ray in the 3 dimensional space. A ray is basically a semiline, given by its origin, a Point3D, and its direction, a Vector3D.

See Also:
Point3D, Vector3D

Field Summary
 Vector3D direction
          The direction of the ray.
 Point3D origin
          The origin of the ray.
 
Constructor Summary
Ray(Point3D origin, Point3D destination)
          Creates a Ray object initialized with the specified origin and whose direction connects the origin with the specified destination.
Ray(Point3D origin, Vector3D direction)
          Creates a Ray object initialized with the specified origin and direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

origin

public Point3D origin
The origin of the ray.

direction

public Vector3D direction
The direction of the ray. This Vector3D is normed upon construction, and it should stay normed.
Constructor Detail

Ray

public Ray(Point3D origin,
           Vector3D direction)
Creates a Ray object initialized with the specified origin and direction.
Parameters:
origin - the origin of the newly constructed Ray.
direction - the direction of the newly constructed Ray.

Ray

public Ray(Point3D origin,
           Point3D destination)
Creates a Ray object initialized with the specified origin and whose direction connects the origin with the specified destination.
Parameters:
origin - the origin of the newly constructed Ray.
destination - the destination that the direction of the newly constructed Ray connects the origin with.