Use the lerp header to pull in the correct lerp

This commit is contained in:
Danny Robson 2012-01-05 13:23:33 +11:00
parent 9c63070718
commit f009e96b91

View File

@ -1,5 +1,6 @@
#include "perlin.hpp"
#include "lerp.hpp"
#include "debug.hpp"
#include "maths.hpp"
@ -7,25 +8,6 @@
#include <limits>
namespace lerp {
double
linear (double a, double b, double weight) {
check (weight >= 0 && weight <= 1.0);
return (1.0 - weight) * a + weight * b;
}
double
cosine (double a, double b, double weight) {
check (weight >= 0 && weight <= 1.0);
double ft = weight * PI;
double f = (1.0 - cos (ft)) * 0.5;
return a * (1.0 - f) + b * f;
}
}
// Just a random generator [-1.0, 1.0]
static float
generate (intmax_t x, intmax_t y) {