#include <gandalf/linalg/3vector.h>for double precision, or
#include <gandalf/linalg/3vectorf.h>for single precision 3-vectors. A double precision 3-vector is defined as
typedef struct Gan_Vector3 { double x, y, z; } Gan_Vector3, Gan_Vector3_dand a single precision 3-vector as
typedef struct Gan_Vector3_f { float x, y, z; } Gan_Vector3_f;
Most of the routines below return a pointer to the result vector/matrix. This may be used as an argument to another routine, although care must be taken with macros as regards multiple evaluation. The routines are very safe, because everything using fixed size vectors & matrices can be written to involve only automatic variables with no dynamic allocation, and the only failure modes are arithmetic overflow (Gandalf does not check for this). The few exceptions are noted in the text.