algorithm - Finding the closest point from a set of points on plane -


N-points given on 2-D aircraft, what is the point that the distance from all the points has decreased? This point should not be from a given set of points, is this center or something else?

"post-text" itemprop = "text" P> This is known as "the distance to the center" and it is different from the centroid.

First you have to determine which distance you are using. If we believe that you are using the standard metric of d = sqrt ((x1-x2) ^ 2 + (y1-y2) ^ 2) then this is not unique, and the problem is reducing this yoga.

The easiest example to show this answer is not unique, an example of a straight line. Any point between the two points is equal to the total distance from all the points.

In 1D, the correct answer will be of any answer, which is the same number of right and left points, till it is true, till then any step towards left and right is left with the same amount in the left and right sides Growth and subtraction, and therefore leave the distance equally. It also proves that the centroid is not the right answer.

If we extend to 2D then this is no longer the case - as the sqrt problem loads. I'm surprised that does not seem to be a standard algorithm! I never knew that the page seems to use an animal force method!

If I want to use an algorithm, then I will get the middle point as the starting point in X and Y, then use one - this answer will be found very quickly, to the whole equation quadratic Ends in the form, so it seems that there should be an accurate solution.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -