This is for the case when maxDistance (the distance between maximally separated nodes is 180).
Then there arises an ambiguity is choosing the globalMaxAngle as +180 or -180 in the transformed positions. And it does make a difference to the answer.
Consider for example the case of 3 positions. 10, -170 and -110.
The maximally separated nodes are 10 and -170. Suppose 10 is chosen as origin and clockwise direction is positive. Then
Case 1: -170 ----> 180 (where ----> denotes transformation)
mean = (-120 + 180 + 0 )/3 = 20
Case 2: -170 ----> -180
mean = (-120 + -180 + 0)/3 = -100
-100 seems to be a better choice because migration distances are smaller this way and it adheres to my policy of "keep the parent node at a position within the bounds of the end nodes"
To achieve this effect, I can count which hemisphere has more number of nodes. If the negative hemisphere has more nodes then its -180 and vice versa.
How to find whether a point is in the +ive or -ive hemisphere, that is given in the last post.
Then there arises an ambiguity is choosing the globalMaxAngle as +180 or -180 in the transformed positions. And it does make a difference to the answer.
Consider for example the case of 3 positions. 10, -170 and -110.
The maximally separated nodes are 10 and -170. Suppose 10 is chosen as origin and clockwise direction is positive. Then
Case 1: -170 ----> 180 (where ----> denotes transformation)
mean = (-120 + 180 + 0 )/3 = 20
Case 2: -170 ----> -180
mean = (-120 + -180 + 0)/3 = -100
-100 seems to be a better choice because migration distances are smaller this way and it adheres to my policy of "keep the parent node at a position within the bounds of the end nodes"
To achieve this effect, I can count which hemisphere has more number of nodes. If the negative hemisphere has more nodes then its -180 and vice versa.
How to find whether a point is in the +ive or -ive hemisphere, that is given in the last post.