#include <matrix.h>
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. | |
| 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. | |
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. | |
1.4.4