This section of the archives stores flipcode's complete Developer Toolbox collection,
featuring a variety of mini-articles and source code contributions from our readers.

Math Library
Submitted by

Here's my hat in the ring for math libraries. It's the math system for the
engine I'm currently developing. I'm posting it in the hopes that someone else
may find it usefull, but because I also want people to nitpick about it, any
errors I may have missed, and ways to improve it. I am still working on the
classes and adding to it, so any help is, of course, appreciated. The engine
also works standalone, the project included compiles as a static library, which
can easily be linked into a project. The include files are all linked through
the GEKXMath.h file, so you only have to include it. The source is also
commented (decently), compatible with (and a project file for) DoXygen source
commentor. So far, it sports quite a few features:

2D/3D/4D vectors (seperate classes, I opted to seperate them instead of
templating them so that I didn't have to specialize anything). I have
overloaded basic operators for conveniance (like plus, minus, multiple, divide.
I didn't want to overload actuall functions (like dot or cross product), because
I felt it gets confusing to overload these, everyone has a different spin on
what symbols to use.

A quaternion class, with everything I've found that I've needed (so far at
least).

A 4x4 matrix class (and conversions between quaternions and matrices in the
classes), with rotations, scaling, etc (everything a matrix should be able to
do).

This program 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.

This program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Please read the file LICENSE.TXT for additional details.

<a href="http://www.doxygen.org>Doxygen</a> was used for all documentation.
*/