This file is part of vm_math
vm_math is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
vm_Math is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
The vm_math 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:
All members are inlined, so the package consists only of header files.
These routines provide the basic low-level support for 1-dimensional arrays of floating point values. The library is a C++ template library, with template parameters T_fp and N_len. T_fp is the floating point type. It must be a simple type (float or double), since it is assumed that the array can be copied as plain ol' data using memcpy. N_len is the dimension of the vector, assumed to be small, e.g., 9 for a flat representation of a 3x3 matrix. The class has no state information with all functionality implemented as (we hope) inlined functions.
To use these routines, ensure that you include the correct header file:
#include <vm_vmath/vm_vmath.h>
#include <vm_vmath/vm_math.h>
These routines provide the basic low-level support for 3-vectors of floating point values of type T_fp (float or double). The library is a C++ template library, templatized on T_fp.
To use these routines, ensure that you include the correct header file:
#include <vm_vmath/vm_v3math.h>
#include <vm_vmath/vm_math.h>
These routines provide the basic low-level support for 3x3 matrices of floating point values of type T_fp (float or double). The library is a C++ template library, templatized on T_fp.
To use these routines, ensure that you include the correct header file:
#include <vm_vmath/vm_m3math.h>
#include <vm_vmath/vm_math.h>