File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
src/compas/geometry/bestfit Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
2222* Allow str or int as joint type in ` compas.robots.Joint ` constructor.
2323* ` compas_ghpython.artists.FrameArtist.draw ` now draws a Rhino Plane.
24+ * Fixed bugs in ` compas.geometry.bestfit_circle_numpy ` .
2425* Changed directory where ghuser components are installed.
2526* Added ghuser components directory to those removed by the ` clean ` task.
26- * Fixed bug in ` compas.geometry.bestfit_circle_numpy ` .
2727
2828### Removed
2929
Original file line number Diff line number Diff line change 44
55from numpy import asarray
66from numpy import sqrt
7- from numpy import mean
87from numpy import zeros
98from numpy .linalg import lstsq
109from scipy .optimize import leastsq
@@ -122,8 +121,10 @@ def f(c):
122121 Ri = dist (* c )
123122 return Ri - Ri .mean ()
124123
125- xm = mean (x )
126- ym = mean (y )
124+ # The mean of x and y are very nearly 0 (1.0e-15), which reveals a numerical
125+ # instability of the problem. So, we choose our initial guess
126+ # to be an epsilon bigger than that.
127+ xm = ym = 0.00001
127128 c0 = xm , ym
128129 c , error = leastsq (f , c0 )
129130
You can’t perform that action at this time.
0 commit comments