APL/APL1.1/SAE11_2021/utils.c

11 lines
189 B
C
Raw Normal View History

2021-11-22 17:29:33 +01:00
#include <math.h>
2021-11-24 10:24:18 +01:00
double LerpF(double a, double b, double t) {
2021-11-22 17:29:33 +01:00
return a + (b - a) * t;
2021-11-29 00:31:21 +01:00
}
int clamp(int x, int min, int max) {
x = x > max ? max : x;
x = x < min ? min : x;
return x;
2021-11-22 17:29:33 +01:00
}