diff --git a/polynome.py b/polynome.py index a807c3ebb775ec4b520c02ac404a1f10ac65b2f0..0a747a7d507c26144b26b400e1ea36c0febe6776 100644 --- a/polynome.py +++ b/polynome.py @@ -45,5 +45,18 @@ class polynome(): # Using horner method res = 0 for i in range(len(self.coefs) - 1, -1, -1): - res = (res * x + self.coefs[i]) % self.prime_mod + res = (res * x + self.coefs[i]) return res + + def plot(self): + import matplotlib.pyplot as plt + import numpy as np + + x = np.arange(-100, 100, 0.001) + y = [self.evaluate(i) for i in x] + # print(f"{x=}") + # print(f"{y=}") + print(self.evaluate(-1.9)) + + plt.plot(x, y) + plt.show() \ No newline at end of file