Yes, you can create a set of simultaneous equations whose solution tells you the answer.
Unfortunately it is a set of simultaneous nonlinear equations. Which tells me that you are extremely unlikely to find an analytical solution - you must go to numerical methods.
You can get an idea of the difficulties if you look at a few special cases.
As everyone has noted, we know that we can find the peak if it is in the middle but we can't find the height or slope. (I am assuming that the slope is positive, if you allow any slope then the same results could be achieved by having the slope be 0 and the position unknowable.)
A more interesting special case is where points 1 and 2 are at the same height, but 3 is not. From the fact that 1 and 2 are at the same height, we know that the answer must lie along the line bisecting them. Because it is on that line we know that points 3 and 4 are also at the same height. By assuming that the slope is positive we can figure out which half of that line the peak is on. But we can't find where it is! The problem is that we need to find 4 variables from 4 data points, but 2 pairs of data points are giving us redundant information, so we wind up with 3 pieces of useful information which is not enough to nail down 4 variables.
Now let's go for a more promising case. For ease of reference, let's say that points 1, 2, 3 and 4 are at (1,0), (0,1), (-1,0) and (0,-1) respectively. Let's suppose that the height at points 2 and 4 are the same, and 1 is higher than 2. From the symmetry of points 2 and 4, the peak must be on the x-axis. Since the slope is positive, it must be closer to point 1 and point 3. Can we find it?
Well let's label the slope S, the height H, and the location of the peak (x,y). Then in general we have:
h(u,v) = H - S*sqrt((x-u)**2 + (y-v)**2)
In this case we know that y is 0. And by the assumption that the peak is in the box we know that 0<x<1. So we have
h1 = h(1,0) = H - S*(1 - x)
h2 = h(0,1) = H - S*sqrt(1 + x*x)
h3 = h(-1,0) = H - S*(1 + x)
Well let's try to solve this for x. First subtract h3 from everything to get rid of H.
-h3 + h1 = S*(1 + x) - S*(1 - x) = 2*S*x
-h3 + h2 = S*(1 + x) - S*sqrt(1 + x*x)
-h3 + h3 = 0
Now let's get rid of S by multiplying by 2 and dividing by (h1-h3)/2.
2 * (-h3 + h1) / (h1 - h3) = 2
2 * (-h3 + h2) / (h1 - h3) = (1 + x - sqrt(1 + x*x)) / x
= 1/x + 1 - sqrt(1/x**2 + 1)
And for the last expression, its derivative is:
-1/x**2 + 1/(x**3 * sqrt(1 + 1/x**2))
This is a complicated derivative, but if you note that that for 0 < x, sqrt(1 + 1/x**2) > 1/x you'll see that the second term is slightly less than the first term, so for 0 < x < 1 this complex expression is monotone decreasing.
Therefore it can be uniquely solved for x. And once you have x, then H and S are easy to find. But good luck finding an analytical solution for x!
So we have 2 degenerate cases that we can't solve. And 1 that we can't solve analytically but can numerically. What about the general case? Well as I've been saying, we have 4 data points and 4 variables to solve, so generally it should be solvable. But we probably can't find an analytic solution. So I'd expect from general principles that the general case, excepting the known degenerate ones, can be solved numerically. And the odds against an analytical solution are so high that I won't waste time looking.
Incidentally if you move just one point, for example make the first point be (2,0), then there are no degenerate cases and I'd be willing to bet that you can always find the answer numerically. But again, a simple analytical solution is unlikely to exist.
If you want to enjoy looking, go ahead. I think that there will be unlimited fun. (Unlimited because you'll never find an answer....) But if you actually need an answer, go with a numerical approach. |