Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x_ = [0, -1, 1]
- y_ = [0, 1, 1]
- x = 4
- ####
- n = len(x_)
- y = 0
- for i in range(0, n):
- p = 1
- for j in range(0, n):
- if i == j:
- continue
- p *= (x - x_[j]) / (x_[i] - x_[j])
- y += p * y_[i]
- ####
- print(y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement