I have a rectangular grid with cell centers defined by y-coordinates (array y
) and x-coordinates (array x
). Interfaces are defined similarly in arrays xi
and yi
. Then there is a function f(x) that goes through that grid. This could be a simple line but can also be a more complicated curve (hence Bresenham's Algorithm might not work).
Is there a simple (python) way to find all the grid cells that are intersected by the curve?