2.1 The Foundation 17
Vector operator* (float c) const; // V*c
friend Vector operator* (float c, Vector V) const; // c*V
private:
float tuple[4]; // tuple[3] = 0 always
};
The interface for the Point class has minimally the following structure:
class Point
{
public:
// ‘this’ is point P
Point operator+ (Vector V); //P+V,Equation (2.12)
Point operator- (Vector V); //P-V,Equation (2.12)
Vector operator- (Point Q); //P-Q,Equation (2.11)
static Point AffineCSum (int N, float c[], Point Q[]); // Equation (2.13)
static Vector AffineDSum (int N, float d[], Point Q[]); // Equation (2.14)
private:
float tuple[4]; // tuple[3] = 1 always
};
I have shown the points and vectors stored as 4-tuples. The fourth component
should be private so that applications cannot access