Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50fb1aeb authored by Andy Hung's avatar Andy Hung
Browse files

Spline: Fix monotonicity constraint

Test: comparison of code to formula
Change-Id: Ie7c8b3a2a6bc64ea3c837a6674b55c07fe49e12b
parent 30110eae
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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;
                    }
                }
            }