Free math library?

Started by
7 comments, last by BrianL 17 years, 5 months ago
I am trying to resist the urge to write my own math library. I have looked around a bit for a light weight set of math classes (matrix, vector, quat, etc) with a liberal license (ie MIT, BSD, etc). I also want something cross platform, so the DX set of functions is out for example. Any recommendations? I looked at the Magic Software library a while ago, but it was rather huge/heavy weight. I am closing in on the point where it feels like writing and testing my own classes would be simpler than finding a library that meets my needs.
Advertisement
David Henry's website has one.
Paul Nettle has a matrix class (under "Code")
Boost has uBLAS (basic linear algebra), a miscelaneous math library (octonion/quaternion, trigonometric functions, and common factor), and a few other things. I've never really used them, but judging by the rest of their code it's probably a safe bet.


jfl.
I think you could do worse than the Magic Software code (make sure you check the license, though!)

There'a also a slow-cooking project to create a "standard" game math library, at http://game-math3d.sourceforge.net/ -- there are a few different proposals in there.
enum Bool { True, False, FileNotFound };
Quote:Original post by hplus0603
I think you could do worse than the Magic Software code (make sure you check the license, though!)


The company and software has not been called "Magic Software" for some time (now Geometric Tools with Wild Magic as the library name). The Wild Magic 3.x license is about to be modified to LGPL. The Wild Magic 4 license indicates it is "viewable source" and not "open source".
Honestly, if all you want is matrix/vector/quaternion stuff, you could roll your own library in a day or two. Just make sure you test it *very* thoroughly. :)
Orin Tresnjak | Graphics ProgrammerBethesda Game StudiosStandard Disclaimer: My posts represent my opinions and not those of Bethesda/Zenimax, etc.
Quote:Original post by lancekt
Honestly, if all you want is matrix/vector/quaternion stuff, you could roll your own library in a day or two. Just make sure you test it *very* thoroughly. :)


Kinda what the OP was attempting to avoid...
Quote:Original post by BrianL
Any recommendations? I looked at the Magic Software library a while ago, but it was rather huge/heavy weight.


The vector/matrix/quaternion stuff is really not that large a quantity of code. Strip out of those classes what you don't want.
Quote:Original post by lancekt
Honestly, if all you want is matrix/vector/quaternion stuff, you could roll your own library in a day or two. Just make sure you test it *very* thoroughly. :)


Thats what I am leaning towards at this point. The post here was a last ditch effort to avoid reinventing the wheel.

On a past project, I tried pulling bits out of the old Magic Software library . This worked, but class API just felt inconsistent with the rest of the code. Writing me own would be good practice and would give me a more consistent interface.

Thanks for the suggestions all.

This topic is closed to new replies.

Advertisement