diff --git a/ex5.py b/ex5.py index eb6496e..1417a14 100644 --- a/ex5.py +++ b/ex5.py @@ -29,3 +29,28 @@ def interpolation_newton(points: list[Point], x: float) -> float: a_i *= (points[k+1].y - points[k].y) / (points[k+1].x - points[k].x) return interpolation + + +def ex1() -> None: + p1 = Point(-1, 0) + p2 = Point(0, -1) + p3 = Point(1, 0) + p4 = Point(3, 70) + + points = [] + points.append(p1) + points.append(p2) + points.append(p3) + points.append(p4) + + """ + + """ + + racine_x_2 = interpolation_lagrange(points, 2.0) + racine_x_3 = interpolation_lagrange(points, 3.0) + print(f'racine X = 2 = {racine_x_2}, racine X = 3 = {racine_x_3}') + + +if __name__ == '__main__': + ex1()