fix definite_integral

This commit is contained in:
lukew3
2020-10-20 13:13:38 -04:00
parent bdd504b6dd
commit ee6fe524de
4 changed files with 95 additions and 95 deletions

View File

@@ -93,4 +93,4 @@ from .decimal_to_roman_numerals import *
from .degree_to_rad import *
from .radian_to_deg import *
from .differentiation import *
from .definiteIntegralFunc import *
from .definite_integral import *

View File

@@ -1,5 +1,4 @@
from .__init__ import *
from ..__init__ import Generator
from scipy.integrate import quad
@@ -15,11 +14,13 @@ def definiteIntegralFunc(max_coeff=100):
result = quad(integrand, 0, 1, args=(a, b, c))[0]
S = round(result, 4)
problem = "The definite integral within limits 0 to 1 of the equation " + str(a) + "x^2 + " + str(b) + "x + " + str(c) + " is = "
problem = "The definite integral within limits 0 to 1 of the equation " + \
str(a) + "x^2 + " + str(b) + "x + " + str(c) + " is = "
solution = str(S)
return problem, solution
definiteIntegral = Generator("Definite Integral of Quadratic Equation", 110, "The definite integral within limits 0 to 1 of quadratic equation ax^2+bx+c is = ", "S", definiteIntegralFunc)
definite_integral = Generator("Definite Integral of Quadratic Equation", 89,
"The definite integral within limits 0 to 1 of quadratic equation ax^2+bx+c is = ", "S", definiteIntegralFunc)