Spline: Fix monotonicity constraint

Test: comparison of code to formula
Change-Id: Ie7c8b3a2a6bc64ea3c837a6674b55c07fe49e12b
This commit is contained in:
Andy Hung
2017-02-10 13:16:45 -08:00
parent 30110eaeec
commit 50fb1aebd7

View File

@@ -166,10 +166,10 @@ public abstract class Spline {
+ "monotonic Y values.");
}
float h = (float) Math.hypot(a, b);
if (h > 9f) {
if (h > 3f) {
float t = 3f / h;
m[i] = t * a * d[i];
m[i + 1] = t * b * d[i];
m[i] *= t;
m[i + 1] *= t;
}
}
}