![](/user_photo/89358_Kx_el.jpg)
Добавил:
Lybov_Vernis
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Вариант 17 / 2 / 2t
.py import math
x = [0.95, 1, 1.05, 1.1]
y = [-0.6565, -0.2, 0.294, 0.827]
z = 1.02
l1 = ((z - x[1])/(x[0] - x[1])) * y[0] + ((z - x[0])/(x[1] - x[0])) * y[1]
l2 = (((z - x[1])/(x[0] - x[1])) * ((z - x[2])/(x[0] - x[2])) * y[0]) + (((z - x[0])/(x[1] - x[0])) * ((z - x[2])/(x[1] - x[2])) * y[1]) + (((z - x[0])/(x[2] - x[0])) * ((z - x[1])/(x[2] - x[1])) * y[2])
l3 = (((z - x[1])/(x[0] - x[1])) * ((z - x[2])/(x[0] - x[2])) * ((z - x[3])/(x[0] - x[3])) * y[0]) +(((z - x[0])/(x[1] - x[0])) * ((z - x[2])/(x[1] - x[2])) * ((z - x[3])/(x[1] - x[3])) * y[1]) + (((z - x[0])/(x[2] - x[0])) * ((z - x[1])/(x[2] - x[1])) * ((z - x[3])/(x[2] - x[3])) * y[2]) + (((z - x[0])/(x[3] - x[0])) * ((z - x[1])/(x[3] - x[1])) * ((z - x[2])/(x[3] - x[2])) * y[3])
print(l1, abs(l2 - l1))
print(l2, abs(l3 - l2))
print(l3)
x = [0.95, 1, 1.05, 1.1]
y = [-0.6565, -0.2, 0.294, 0.827]
z = 1.02
l1 = ((z - x[1])/(x[0] - x[1])) * y[0] + ((z - x[0])/(x[1] - x[0])) * y[1]
l2 = (((z - x[1])/(x[0] - x[1])) * ((z - x[2])/(x[0] - x[2])) * y[0]) + (((z - x[0])/(x[1] - x[0])) * ((z - x[2])/(x[1] - x[2])) * y[1]) + (((z - x[0])/(x[2] - x[0])) * ((z - x[1])/(x[2] - x[1])) * y[2])
l3 = (((z - x[1])/(x[0] - x[1])) * ((z - x[2])/(x[0] - x[2])) * ((z - x[3])/(x[0] - x[3])) * y[0]) +(((z - x[0])/(x[1] - x[0])) * ((z - x[2])/(x[1] - x[2])) * ((z - x[3])/(x[1] - x[3])) * y[1]) + (((z - x[0])/(x[2] - x[0])) * ((z - x[1])/(x[2] - x[1])) * ((z - x[3])/(x[2] - x[3])) * y[2]) + (((z - x[0])/(x[3] - x[0])) * ((z - x[1])/(x[3] - x[1])) * ((z - x[2])/(x[3] - x[2])) * y[3])
print(l1, abs(l2 - l1))
print(l2, abs(l3 - l2))
print(l3)