stfu/Source/interp.c

9 lines
214 B
C

#if defined(STFU_MAIN) && !defined(STFU_INTERP)
#define STFU_INTERP
float stfu_linear_interpolate(float x0, float y0, float x1, float y1, float n) {
return (y0 * (x1 - n) + y1 * (n - x0)) / (x1 - x0);
}
#endif