(v, func)
| 594 | return this.polynomial(...out) |
| 595 | } |
| 596 | f(v, func) { |
| 597 | if (typeof v == 'function') { |
| 598 | return { |
| 599 | type: "function", |
| 600 | core: v |
| 601 | } |
| 602 | } |
| 603 | return { |
| 604 | type: "function", |
| 605 | v: v, |
| 606 | f: func, |
| 607 | core: x => { |
| 608 | let regex = new RegExp(v) |
| 609 | let newStr = func.replace(regex, `(${x})`) |
| 610 | return eval(newStr).toFixed(14) |
| 611 | } |
| 612 | } |
| 613 | } |
| 614 | findRoots(f) { |
| 615 | let exp = []; |
| 616 | if (f.type == "polynomial") { |