Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

Point Class Reference

Class representing a 3D point. More...

#include <matrix.h>

List of all members.

Public Member Functions

 Point ()
 Default constructor. Initializes point to (0,0,0).
 Point (float s)
 Constructor initializing all elements to the given value.
 Point (float _x, float _y, float _z)
 Constructor initializing point to (x,y,z).
virtual ~Point ()
 Destructor. Does nothing.
float operator() (int i) const
 Returns a copy of the element at position (i).
float & operator() (int i)
 Returns a reference to the element at position (i).
Point operator+ (const Vector &v) const
 Addition of point and vector.
Point operator+ (const Point &p) const
 Addition of two points. Not mathematically sensible but convenient to have.
Pointoperator+= (float s)
 Addition of scalar in place.
Point operator- (const Vector &v) const
 Subtraction of point and vector.
Point operator- (const Point &p) const
 Subtraction of two points. Not mathematically sensible but convenient to have.
Pointoperator-= (float s)
 Subtraction of scalar in place.

Public Attributes

float x
 First component.
float y
 Second component.
float z
 Third component.

Friends

std::ostream & operator<< (std::ostream &os, const Point &A)
 Write elements to an output stream.


Detailed Description

Class representing a 3D point.

The main difference between Point and Vector is how they are transformed by a transformation matrix. The point is assumed to have the 4th component set to 1, so that it is affected by translations, while the vector just represents a direction and hence is not affected by translations.


The documentation for this class was generated from the following file:
Generated on Sun Mar 26 19:14:13 2006 for ASR by  doxygen 1.4.4