I have coordinates of five points let say A, B, C, D, E and I need to find the coordinate of a point (M) where the distance of each point to the M be minimal. so sum of AM, BM, CM, DM, EM is minimum.

2

There are 2 answers

0
Micromega On

Easiest is linear transformation but you can try the harvesine formula.

0
MBo On

You have already used tag centroid, but it is known that centroid as arithmetic mean of a finite set of points minimizes the sum of squared Euclidean distances between itself and each point in the set.

So it's enough to find centroid coordinates as

M.X = (A.X + B.X + C.X + D.X + E.X) / 5 
M.Y = (A.Y + B.Y + C.Y + D.Y + E.Y) / 5