paul_math.h

Includes:
<stdio.h>
<stdint.h>
<stdarg.h>
<string.h>
<tgmath.h>
<array>
<initializer_list>
<stdexcept>
<algorithm>
<stdbool.h>

Introduction

Linear algebra library for C/C++.

Discussion

Implementation is included when PAUL_MATH_IMPLEMENTATION or PAUL_IMPLEMENTATION is defined.

Updated:
Monday, September 29, 2025


Groups

Matrices

Matrix types and transformation helpers (mat2/3/4)

Discussion

Matrix creation and manipulation functions, plus helpers to construct translation/rotation/scale matrices, camera projection matrices (frustum, perspective, ortho) and utilities for transforming/unprojecting vectors. These functions are available when PAUL_MATH_NO_MATRICES is not defined.

 

Vectors

Vector types and helper functions (vec2, vec3, vec4)

Discussion

A set of lightweight vector types and C-style helper functions for common operations (zero, length, dot, normalize, distance, clamp, lerp, etc.). These are provided for vec2, vec3 and vec4 (and integer variants where available). The functions are exported via macros for each supported size.

Group members:

quat

Quaternion type (alias for vec4)

 

Easing

Timing/easing functions for animations and interpolation

Discussion

A set of common easing functions (linear, sine, circular, cubic, quad, exponential, back, bounce, elastic) and easing types (in, out, inout). Use `ease()` to evaluate an easing curve with the signature: ease(fn, type, t, b, c, d) where t is current time, b is start value, c is change in value, and d is duration.


Typedefs

quat

Quaternion type (alias for vec4)


quat


Quaternion type (alias for vec4)

typedef vec4 quat;  
Discussion

A quaternion represented as a 4-component vector (x, y, z, w). Provided as an alias to vec4 for convenience when working with rotations.