The midpoint of two points at the Euclidean distance is just the average of the x and y coordinates. If we just average the latitude and longitude of points A and B, this gives us a point between A and B, but it should not be equidistant.
What you probably want is to convert the spherical coordinates to Euclidean coordinates, find the midpoint by averaging x and y, then convert back to latitude, longitude.
If we do this with more than 2 points, we need to clarify what is meant by the "middle".
If we want to find the midpoint of N points in Euclidean geometry, we simply average all the values of x and average all the values of y. This gives us a reasonable “middle”, but this midpoint is usually not equidistant for all three points. Given three points, we can calculate a unique point equidistant for these three; this point is the circle of a triangle defined by three points. But since three points define a circle, this process is not generalized to n-points. Given 4 or more points, there is probably no point that is equidistant for all 4. This is true if we are working with distance distance of eulidian or spherical geometry.
The diagram below shows that the point of the circle is exactly 5 units from points A, B and C. But this moment really does not look like a “middle” one. On the other hand, the midpoint defined by the average looks like in the middle, although it is closer to A than to B or C.

For n points defined (latitude, longitude), the best way is probably to convert all these points to Euclidean points, calculate the average, and then convert back to (latitude, longitude). Some code for this conversion can be found here: Processing the forum And there is a nice wikipedia page explaining the basic math you need to understand.
Thorn source share