PI

raymath v1.5 - Math functions to work with Vector2, Vector3, Matrix and Quaternions

CONVENTIONS: - Matrix structure is defined as row-major (memory layout) but parameters naming AND all math operations performed by the library consider the structure as it was column-major It is like transposed versions of the matrices are used for all the maths It benefits some functions making them cache-friendly and also avoids matrix transpositions sometimes required by OpenGL

extern (C) @nogc nothrow
enum PI = 3.14159265358979323846f;

Examples

In memory order, row0 is [m0 m4 m8 m12] but in semantic math row0 is [m0 m1 m2 m3] - Functions are always self-contained, no function use another raymath function inside, required code is directly re-implemented inside - Functions input parameters are always received by value (2 unavoidable exceptions) - Functions use always a "result" variable for return - Functions are always defined inline - Angles are always in radians (DEG2RAD/RAD2DEG macros provided for convenience) - No compound literals used to make sure libray is compatible with C++

CONFIGURATION: #define RAYMATH_IMPLEMENTATION Generates the implementation of the library into the included file. If not defined, the library is in header only mode and can be included in other headers or source files without problems. But only ONE file should hold the implementation.

#define RAYMATH_STATIC_INLINE Define static inline functions code, so #include header suffices for use. This may use up lots of memory.

Meta

License

zlib/libpng

Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)

This software is provided "as-is", without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

3. This notice may not be removed or altered from any source distribution.