Closed dura0ok closed 6 months ago
I have some concerns related to the cases when cartesian geometric center lies in the center of the sphere. The following situations are possible:
The center on the sphere is absent. I guess in this case the function returns (0,0).
There are two possible centers on the sphere when two points are locates on the opposite sides of a meridian. But in this case due to rounding issues in most situations out calculated center in 3D will be near the center of the sphere but not exactly there. It affects which point will be choosen as the result and may produce unstable results I guess.
Other popular libraries, except javascript, do not even allow you to check which center of mass they give out for two antipodal points, because they write that a minimum of 6 points is needed to create a polygon. And for some reason the Javascript library writes (0,0), which is fundamentally wrong
We can't compare the function for calculation the centroid of a set of independent points with the calculation of a polygon figure. The set of independent points does not form a figure. We should compare the equivalent function in other spherical geometry libraries if such function exist. The only unresolved question - what to return when the points are on opposite sides. There are two cases: either we have two result points or there are no points at all (when the calculated center in 3D is near the center of the sphere).
There are some conceptual problems with centroid function. I propose to close it as it is not required right now. Later we may reopen it if neeed.
Closed as incomplete.
@esabol @vitcpp please, review it.