I found a function online here for a function to compute for the same delta x and delta y. I am trying to edit it to be able to handle different $\delta (x)$ and $\delta (y)$.
Here are the changes that I have made so far. It works when I have $m=n$, but that makes the deltax and deltay the same too. I can't figure out where I went wrong. Thanks.