mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Rename Curve.solve() -> Curve.solveCubic()
This commit is contained in:
parent
d6b666024b
commit
778a161ba0
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue