Check weight is within bounds for quintic lerp

This commit is contained in:
Danny Robson 2012-05-22 14:12:30 +10:00
parent be0426ff24
commit 2783bcaa23

View File

@ -61,6 +61,7 @@ lerp::cubic (double a, double b, double weight) {
double
lerp::quintic (double a, double b, double weight) {
CHECK (weight >= 0.0 && weight <= 1.0);
double t = weight * weight * weight * (weight * (weight * 6.0 - 15.0) + 10.0);
return a * (1.0 - t) + b * t;
}