bestfit_circle_numpy
- compas.geometry.bestfit_circle_numpy(points)[source]
Fit a circle through a set of points.
- Parameters
points (array_like[point]) – XYZ coordinates of the points.
- Returns
[float, float, float] – XYZ coordinates of the center of the circle.
[float, float, float] – The normal vector of the local frame.
float – The radius of the circle.
Notes
The point of this function is to find the bestfit frame through the given points and transform the points to make the problem 2D.
Once in 2D, the problem simplifies to finding the center point that minimises the difference between the resulting circles for all given points, i.e. minimise in the least squares sense the deviation between the individual radii and the average radius.
For more information see 1.
References
- 1
Scipy. Least squares circle. Available at: http://scipy-cookbook.readthedocs.io/items/Least_Squares_Circle.html.
Examples
>>>