Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

Ray< n > Class Template Reference

Generic n-dimensional ray. More...

#include <geometry.hh>

List of all members.

Public Member Functions

 Ray ()
 Creates a ray pointing from the origin positively along all axes.

 Ray (const Point< n > &start, const Vector< n > &dir)
 Creates a ray from a point and a direction vector.

const Point< n > & getStart () const
 Gets this ray's starting point.

const Vector< n > & getDirection () const
 Gets this ray's (normalized) direction vector.

Point< n > operator() (double d) const
 Evaluates the ray equation for a given scalar, returning the point.


Private Attributes

Point< n > start
 Starting point.

Vector< n > dir
 (Normalized) direction vector.


Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &, const Ray< n > &)
 Outputs a ray to a C++ ostream.


Detailed Description

template<unsigned int n>
class Ray< n >

Generic n-dimensional ray.

Definition at line 325 of file geometry.hh.


Constructor & Destructor Documentation

template<unsigned int n>
Ray< n >::Ray const Point< n > &  start,
const Vector< n > &  dir
[inline]
 

Creates a ray from a point and a direction vector.

Precondition:
dir is normalized.

Definition at line 337 of file geometry.hh.

References Ray< n >::dir.


Friends And Related Function Documentation

template<unsigned int n>
std::ostream & operator<< std::ostream &  ,
const Ray< n > & 
[related]
 

Outputs a ray to a C++ ostream.

Output looks like ray(p<1,2,...,n>,v<1,2,...,n>)

Definition at line 128 of file geometry.impl.


The documentation for this class was generated from the following files:
Generated on Fri Feb 4 10:41:08 2005 for tracer by doxygen 1.3.5