This function takes in row and column coordinates and a range, and uses those inputs to calculate and return a value via linear interpolation between the values in the range. It loops through the rows and columns of the range, calculating slope triangles between points. If the row matches a point, it calculates the value based on that point's slope. Otherwise, it calculates slopes on both sides of the diagonal and uses those to interpolate the value.