Created
October 21, 2016 15:27
-
-
Save danieldiekmeier/7220ab44bb68e1b665410a81ad74a31f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import math | |
items = [10, 3, 4, 10] | |
steps = 10 | |
def make(a, b): | |
print(a, b) | |
result = [] | |
for i in range(steps): | |
result.append(math.sqrt( | |
(((a ** 2) * (steps - i - 1))) + | |
(((b ** 2) * i)) | |
) / steps) | |
return result | |
result = [make(x, y) for x,y in zip(items,items[1:])] | |
print(result) | |
print(list(itertools.chain.from_iterable(result))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment