-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmath.cpp
More file actions
21 lines (18 loc) · 1.08 KB
/
math.cpp
File metadata and controls
21 lines (18 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* math.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abaur <abaur@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/29 16:39:30 by abaur #+# #+# */
/* Updated: 2024/10/20 14:01:03 by abaur ### ########.fr */
/* */
/* ************************************************************************** */
#include "math.hpp"
double lerp(double a, double b, double t){
return a + (b-a)*t;
}
double remap(double iMin, double iMax, double oMin, double oMax, double n){
return oMin + (oMax-oMin)*(n-iMin)/(iMax-iMin);
}