MCPcopy Create free account
hub / github.com/arguiot/TheoremJS / integrate

Method integrate

__test__/theorem.js:731–744  ·  view source on GitHub ↗
(poly)

Source from the content-addressed store, hash-verified

729 return array
730 }
731 integrate(poly) {
732 if (poly.type != 'polynomial') {
733 throw "TheoremJS: Integrate: Not a polynomial"
734 }
735 let values = []
736 for (let i in poly.values.reverse()) {
737 values.push(poly.values[i] / (parseInt(i)+1))
738 }
739 values.reverse()
740 values.push(0)
741 const out = values.filter(a => !isNaN(a))
742
743 return this.polynomial(...out)
744 }
745 numeralSolve(f, end, from = -100, to = 100, step = 0.1) {
746 let buffer = []
747 let index = []

Callers 1

test.jsFile · 0.80

Calls 2

polynomialMethod · 0.95
reverseMethod · 0.80

Tested by

no test coverage detected