A special feature of this library is the quaternion class which implements quaternion math. Quaternions are very useful for attitude determination in 3D space because they do not suffer from singularities. Furthermore, successive rotations and transformations of vectors can be accomplished by simple quaternion multiplication. Attitude dynamics can be expressed in a very compact form using quaternions.

For more information on quaternions and their applications, see: "Spacecraft attitude determination and control", Edited by James Wertz, D. Reidel Publishing Company, Dordrecht: Holland, Boston: U.S.A., London: England.

The original version of CwMtx contains matrices that can be dimensioned dynamically. This is very flexible but it also slows matrix operations down because dynamic memory management is slow. In an attempt to circumvent this disadvantage I created a version of CwMtx that contains statically dimensioned matrices. This speeds up matrix operations considerably. Especially operations on small matrices (3x3, 4x4) and vectors (3x1, 4x1) as used in 3D problems are 3 to 5 times faster than with their dynamically dimensioned counterparts. However, I think CwMtx is not the fastest matrix library around and speed is not the highest priority for me.

If you want to try CwMtx download it using one of the links below. CwMtx is licensed under the Lesser GPL (LGPL). It is written entirely in C++. It was developed on Linux using the C++ compiler from the GNU Compiler Collection but you should be able to use it on any system that has a recent C++-compiler.

**Please read this first**:

Some browsers automatically uncompress
.tar.gz archives if you download them by left-clicking (I know IE does this).
However they do not remove the .gz extension from the filename causing all
kinds of confusion. To prevent this: right-click on the link and choose "Save
Link as ..." or something similar from the menu that pups up.

The latest version of the CwMtx library for dynamically dimensioned
matrices is:

cwmtx-0.6.2.tar.gz

The latest version of the CwMtx library for statically dimensioned matrices
is:

cwmtx-stat-0.6.1.tar.gz

As of version 0.6.0 all function names within the CwMtx namespace have been changed to start with a lowercase letter. (Sorry for the inconvenience but I decided to apply a single name convention to all my software). You can use the sed script linked here to rename functions to start with a lowercase letter. Some manual checking is required after applying the script though.

I ran Doxygen on the raw sources, use these links to view the results.

If you want to read the full documentation in text format, use these links. The documents can be slightly out of date but they are useable.

- full cwmtx documentation in plain ASCII text
- full cwmtx-static-dim documentation in plain ASCII text

If I can find the time I wil integrate the documentation text file with the sources to produce a good documentation set using Doxygen.

This software was converted from a classic object code library to a template library by William DeVore. Jiri Ecer added some extra constructors that create a quaternion from its exponential form q = r * e^(n_hat * theta), where n_hat is a unit vector.

The strength of the templates are that you can use them to generate unusual types of matrices and vectors, like a matrix of quaternions, a vector of square matrices, etc. Nevertheless these unusual datatypes can be very useful for some particular problems. (Please, let me know if you generated some weird-but-useful datatypes with the CwMtx templates.)

- Freshmeat.net contains software for many areas of application. It specialises in Free Software and Open Source Software. I strongly recommend you use the search facilities of Freshmeat otherwise you will be completely overwhelmed by the number of interesting packages.
- SourceForge.net contains the homepages of many Free Software and Open Source Software projects. You can access the source code repository (CVS) of most projects through this site. Like Freshmeat it is huge. Use the search facilities to find what you need quickly.
- Mathtools.net a portal site containing a large collection of links to Scientific and Engineering software. Registration is required (free of charge). It links to commercial and non-commercial software.
- John Ahlgren's Scientific Calculator. John build a commandline scientific calculator named Cxc. It works a bit like GNU bc but Cxc can do matrix calculations too! Cxc uses the CwMtx matrix library. Unfortunately his homepage has gone offline and I do not know what the status of his calculator project is.

If you have any questions or remarks on CwMtx, please let me know.

**Harry Kuiper (hkuiper at xs4all dot nl)**