Let's say that I have the rainfall in millimeters for each point on a 2-dimensional map.
I want to find the (x,y) coordinate of a circle of radius R that has received the maximum amount of rain.
Something like (for a square actually, probably in polar coordinate it will be easy to express a circle)
$$mm(x,y,R)=\int\limits_{x-R}^{x+R}\int\limits_{y-R}^{y+R}f(s,t)dsdt$$
and I want to find the point (x,y) that gives the maximum value of mm, given R fixed.
I'd like to frame the problem from a mathematical point of view.
From a computational point of view, I'll be dealing with a discrete function f as I'll have values for rainfall on a discrete grid.
I've seen some algorithms trying to calculate the mm by actually calculating the integral over many values of (x,y), but that looks to me like a brute force approach.
Is there any other mathematical way of solving this? I wouldn't mind if I find a square or a circle, the concept will be the same