
~/~0 CHAPTER 3 Vectors
C++ API
The triangle's area is calculated using the following.
MVector a( 1.0, 0.0, 0.0 );
MVector b( 0.0, 1.0, 0.0 );
MVector c- a ^ b;
double triArea = 0.5 * c.length();
3.11
POINTS VERSUS VECTORS
Because a point and a vector both have three dimensions, it may seem logical to con-
sider them equivalent. They are, in fact, geometrically and mathematically different.
Geometrically, a vector has a direction and a length, whereas a point has a position.
Mathematically, a point and a vector are represented by homogeneous coordinates as
follows.
P = (Px, Py, Pz, 1)
v = (Vx, Vy, Vz, O)