Skip to content

A math library that defines types such as vectors, matrices and quaternions as well as utility functions

Notifications You must be signed in to change notification settings

BloodLantern/MathToolbox

Repository files navigation

C++ Math Toolbox

This library defines a set of math types and functions to easily manipulate vectors, quaternions and matrices for the C++ programming language.

Language version and architecture

This project is compiled using C++23 features (/std:c++latest), on MSVC, for the x64 architecture.

You could actually build the project from source for the x86 architecture, but the releases and project configurations are all for x64.

Documentation

The Doxygen documentation can be found online or manually generated using the Doxyfile.

Most types and functions have documentation in their respective header files so you can always check them if needed.

What is included

In addition to the common types like vectors in 2, 3 and 4 dimensions, quaternions and 4x4 matrices, this library provides the Vector2i type. This is a vector in 2 dimensions but for integer values. This can be useful when working with resolutions, or more generally when using exact pixel coordinates. All those types are defined in the global namespace so that they are very easy and quick to use.

In the Calc namespace, mathematical constants and some useful, general use functions are defined.

The majority of this library functions are constexpr, which means that their calls can be resolved at compile-time which allows a faster execution at run-time.

All rotation angles are in radians. If you want to use degrees instead, multiply your degree angle by Calc::Deg2Rad. This will give you the same amount but in radians.

To use this library, you can #include the specific file you need, or you can instead #include the math.hpp file, which contains every other header for you.

About

A math library that defines types such as vectors, matrices and quaternions as well as utility functions

Resources

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages