Locating center of datapoints
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I want to find the center of data (X and Y coordinates) and if all data points are plotted the outer line represents a circle. Here is my problem, the data contains outlaws (one or more points that do not fall within the circle) also the circles outlines are of different size veering from 3cm to 6cm in diameter. What is the best way to solve this problem with general algorithm?
I know that the radius of circle is: r = sqrt((X - Xcenter).^2 + (Y - Ycenter).^2) and that I need to find the optimal r which is between 3cm/2 and 6cm/2 but also I need to located the exact center of the datapoints.
Note that the data points are not evenly distributed within the circle.
All hints / solutions are greatly precipitated.
0 Kommentare
Antworten (2)
Torsten
am 27 Okt. 2014
Use lsqnonlin for the problem
min: sum_{i=1}^{N} ((x_i-x_c)^2+(y_i-y_c)^2-R^2)^2
where (x_i,y_i) are your data points.
The unknowns are x_c, y_c and R where (x_c,y_c) is the center of the circle and R is its radius.
Best wishes
Torsten.
Torsten
am 6 Nov. 2014
The problem you described is different from what I thought at the first glance and looks quite tough to me.
You may want to perform a Google search for
"enclose the maximum number of points by a circle with given radius".
The link
seems to provide an algorithm written in C to solve this problem.
You can look at the solution for different radii and choose the one that fits your needs best.
Best wishes
Torsten.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Legend finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!