Solved Task 2.1
This commit is contained in:
@@ -15,11 +15,9 @@ def showPlot(xmin, xmax, xsteps):
|
|||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
def polynom_function(coefficients, x):
|
def polynom_function(coefficients, x):
|
||||||
n = len(coefficients) - 1
|
|
||||||
result = 0
|
result = 0
|
||||||
for power, coefficient in enumerate(coefficients):
|
for power, coefficient in enumerate(coefficients):
|
||||||
result += coefficient * x ** power
|
result += coefficient * x ** power
|
||||||
power += 1
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def plot_polynom_function(coefficients, xmin, xmax, xsteps):
|
def plot_polynom_function(coefficients, xmin, xmax, xsteps):
|
||||||
|
|||||||
Reference in New Issue
Block a user