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

Point< n > Class Template Reference

Generic n-dimensional point. More...

#include <geometry.hh>

Collaboration diagram for Point< n >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Point ()
 Defaults constructor initializes to origin.

 Point (const double data[n])
 Constructors for initializing to given value.

double operator[] (unsigned int i) const
 Gets a component of the point.

const Point< n > & operator+= (const Vector< n > &v)
 Adds a vector to this point.

const Point< n > & operator-= (const Vector< n > &v)
 Subtracts a vector from this point.

const Matrix< n+1, 1 > & getMatrix () const
 Returns the matrix used to represent this point.


Private Attributes

Matrix< n+1, 1 > data
 The matrix representing this point.


Related Functions

(Note that these are not member functions.)

Point< n > operator+ (const Point< n > &a, const Vector< n > &b)
 Adds a point and a vector.

Point< n > operator- (const Point< n > &a, const Vector< n > &b)
 Subtracts a point and a vector.

std::ostream & operator<< (std::ostream &, const Point< n > &)
 Outputs a Point to a stream.


Detailed Description

template<unsigned int n>
class Point< n >

Generic n-dimensional point.

Definition at line 132 of file geometry.hh.


Friends And Related Function Documentation

template<unsigned int n>
Point< n > operator+ const Point< n > &  a,
const Vector< n > &  b
[related]
 

Adds a point and a vector.

See also:
Point::operator+=(const Vector<n>&)

Definition at line 168 of file geometry.hh.

template<unsigned int n>
Point< n > operator- const Point< n > &  a,
const Vector< n > &  b
[related]
 

Subtracts a point and a vector.

See also:
Point::operator-=(const Vector<n>&)

Definition at line 177 of file geometry.hh.


Member Data Documentation

template<unsigned int n>
Matrix<n+1,1> Point< n >::data [private]
 

The matrix representing this point.

Position (i,0) is the value of dimension i. Position (n,0) is always 1.0.

Definition at line 159 of file geometry.hh.

Referenced by Point< 3 >::operator[](), and Point< n >::Point().


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