n-Dimensional Line to Points (Bresenham Decomposition?)
#output a series of points that take you from the start point to the end point
#each list corresponds to each dimension of the line
def line_to_pts(start, end):
dims = [abs(i - j) for i, j in zip(start, end)]
max_dim = dims.index(max(dims))
max_diff = abs(end[max_dim] - start[max_dim])
points = []
for dim in range(len(start)):
t = []
for i in range(max_diff + 1):
t.append(start[dim] + (end[dim] - start[dim]) / max_diff * i)
points.append(t)
return points
start = [3, 20]
end = [5, 10]
print(line_to_pts(start, end))