B
B
Burk75892020-09-10 10:19:33
C++ / C#
Burk7589, 2020-09-10 10:19:33

How to restore a circle from an array of points?

Prompt an algorithm for restoring a circle from an array of points and determining the center of this circle and the diameter or radius.
5f59d2e7e96c0369883448.png

Answer the question

In order to leave comments, you need to log in

4 answer(s)
T
twobomb, 2020-09-10
@Burk7589

Well, as an option, we find the extreme points: upper left, upper right, lower right and lower left.
As a result, we get a rectangle and inscribe a circle in this rectangle

D
dollar, 2020-09-10
@dollar

And how are they distributed? If it is uniform, or at least symmetrical, then first we look for the center of mass (the arithmetic mean of all coordinates in X and Y separately, because the "masses" are equal), and then we calculate the average distance of the points from this center - this will be the radius . The center and radius are the circle.
But if not evenly and symmetrically, then it's hard to say. For example, this case:

spoiler
5f59dc800df79221516740.png

A
Armenian Radio, 2020-09-10
@gbg

Read about the Hough transform for circles

A
AnT, 2020-09-10
@TheCalligrapher

Use the Emo Welzl algorithm to construct the minimum enclosing circle
https://www.cyberforum.ru/geometry/thread1926478.h...
www.stsci.edu/~RAB/Backup%20Oct%2022%202011/f_3_Ca. ..
Then reduce the radius of the found circle (by fixing the center) so that the number of points inside and outside becomes approximately the same.
Since you did not give any detailed requirements for the desired circle, this algorithm will be no better and no worse than any others.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question