VisExercises

3D Vectors with C++

With C++ we use the “v3d.h” vector header as part of the frame work to represent 3D vectors as C++ object.

#include "v3d.h"

The vector header also provides overloaded vector operators +, - and *. For example the addition of two vectors c=a+b is written as:

v3d a(1,0,0),b(0,1,0);
v3d c=a+b;


Options: