vm_Math Package

This package brings together a number of functions for operating on 3-vectors and 3-matrices, and for creating orthonormal 3-matrices corresponding to proper rotations (i.e., orthonormal matrices preserving the coordinate system parity).

These are implemented as inlined static member functions; the functions are bundled into classes in order to take them out of the global namespace. By making the functions static member functions, they can be called without recourse to a an instantiated object, e.g.

double v1[] = { 1.3, 2.4, 7.2, 9.7 }; double v2[] = { 7.2, 1.9, 3.1, 4.1 }; double foo = vm_VMath<double,4>::dot( v2, v1 );

The package currently contains 3 classes:

  • vm_VMath<T_fp,N_len>, common numerical operations on N_len-long one-dimensional arrays of floating point type T_fp. This class captures operations which do not depend on the explicit 3-vector or 3x3-matrix properties.
  • vm_V3math<T_fp>, common numerical operations on 3-vectors of floating point type T_fp. Publicly derives from vm_VMath<T_fp,3>. This class adds in specifically 3-vector functionality such as vector cross products.
  • vm_M3math<T_fp>, common numerical operations on 3x3 matrices of floating point type T_fp. The matrix is assumed to be stored as a contiguous one-dimensional array of 9 T_fp's. Publicly derives from vm_VMath<T_fp,9>. This class adds in specifically 3x3-matrix properties such as 3x3 matrix multiplication and matrix-vector multiplication.
  • Currently all members are inlined, so the package consists only of the header files

  • vm_math.h, package header; includes vm_vmath.h, vm_v3math.h, and vm_m3math.h
  • vm_vmath.h, includes vm_VMath<T_fp,N_len> functions.
  • vm_v3math.h, includes vm_V3Math<T_fp> functions.
  • vm_m3math.h, includes vm_M3Math<T_fp> functions.
  • Class Index
    Terry Gaetz
    Last modified: Mon Jan 12 13:26:47 EST 1998