I have a grid that represents a sampling of a continuous function in a 2 dimensional space. I'm looking for a (preferably fast) algorithm that can calculate the discrete line integral along a straight-line path from one grid cell to a distant grid cell.
This seems like it would be a canonical problem with an accepted solution, but I can't seem to find anything online or in my resources. I've made an algorithm that works for uniform grids, but occasionally hiccups when the cell height and cell width differ by a large amount due to floating point precision.
My hope is that someone has seen this problem before and can get me pointed in the right direction.