A single-file, cross-platform, public domain graphics math library for both C and C++. Supports vectors, matrices, quaternions, and all the utilities you'd expect.
To get started, go download the latest release.
If you are upgrading to Handmade Math 2.0, save yourself some time and use our automatic update tool.
Here's what sets Handmade Math apart:
#include "HandmadeMath.h"._Generic versions of common operations.HMM_Vec3 can be accessed as XYZ, RGB, or UVW - or subsets can be accessed like .XY and .YZ.Simply #include "HandmadeMath.h". All functions are static inline, so there is no need for an "implementation" file as with some other single-header libraries.
A few config options are available. See the header comment in the source for details.
What's the license?
This library is in the public domain. You can do whatever you want with it.
Where can I contact you to ask questions?
Feel free to make GitHub issues for any questions, concerns, or problems you encounter.
What if I don't want the HMM_ prefix?
Do a find and replace in the library source.
$ claude mcp add HandmadeMath \
-- python -m otcore.mcp_server <graph>