bestfit_circle_numpy
- compas.geometry.bestfit_circle_numpy(points)[source]
Fit a circle through a set of points.
- Parameters
points (list) – XYZ coordinates of the points.
- Returns
tuple – XYZ coordinates of the center of the circle, the normal vector of the local frame, and 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
>>>