Spline: Fix monotonicity constraint
Test: comparison of code to formula Change-Id: Ie7c8b3a2a6bc64ea3c837a6674b55c07fe49e12b
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user