Rename Curve.solve() -> Curve.solveCubic()

This commit is contained in:
Jürg Lehni 2011-07-06 23:10:16 +02:00
parent d6b666024b
commit 778a161ba0

View file

@ -311,7 +311,8 @@ var Curve = this.Curve = Base.extend(/** @lends Curve# */{
// Solve the y-axis cubic polynominal for point.y and count all
// solutions to the right of point.x as crossings.
var vals = this.getValues(),
roots = Curve.solve(vals[1], vals[3], vals[5], vals[7], point.y),
roots = Curve.solveCubic(vals[1], vals[3], vals[5], vals[7],
point.y),
crossings = 0;
for (var i = 0, l = roots != Infinity && roots.length; i < l; i++) {
var t = roots[i];
@ -493,7 +494,7 @@ var Curve = this.Curve = Base.extend(/** @lends Curve# */{
// Converts from the point coordinates (p1, c1, c2, p2) for one axis to
// the polynomial coefficients and solves the polynomial for val
solve: function (p1, c1, c2, p2, val) {
solveCubic: function (p1, c1, c2, p2, val) {
return Numerical.solveCubic(
p2 - p1 + 3 * (c1 - c2), // a
3 * (c2 + p1) - 6 * c1, // b