srp
software rendering pipeline
Loading...
Searching...
No Matches
utils.h File Reference
#include <math.h>
Include dependency graph for utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _USE_MATH_DEFINES
 
#define M_PI   3.14159265358979323846
 
#define MIN(a, b)   ( (a) > (b) ? (b) : (a) )
 
#define MAX(a, b)   ( (a) > (b) ? (a) : (b) )
 
#define CLAMP(min, max, value)
 
#define FRACTIONAL(x)   ( (x) - floor(x) )
 
#define EPSILON   1e-9
 
#define ROUGHLY_EQUAL(a, b)   (fabs((a) - (b)) <= EPSILON)
 
#define ROUGHLY_ZERO(x)   (fabs(x) <= EPSILON)
 
#define ROUGHLY_LESS_OR_EQUAL(a, b)   ((a) <= (b) + EPSILON)
 
#define ROUGHLY_GREATER_OR_EQUAL(a, b)   ((a) >= (b) - EPSILON)
 

Detailed Description

Utility macros related to mathematics