add accuracy to getCircleCenter method

This commit is contained in:
edi271
2022-01-29 16:30:56 +01:00
committed by WandererFan
parent af82959b02
commit 049889b72f

View File

@@ -932,7 +932,7 @@ Base::Vector2d Geom2dCircle::getCircleCenter (const Base::Vector2d &p1, const Ba
double vv = v*v;
double ww = w*w;
if (uu * vv * ww == 0)
if (abs(uu * vv * ww) < 0.01)
THROWM(Base::ValueError,"Two points are coincident");
double uv = -(u*v);
@@ -945,7 +945,7 @@ Base::Vector2d Geom2dCircle::getCircleCenter (const Base::Vector2d &p1, const Ba
double wx = w0 + w1 + w2;
if( wx == 0)
if( abs(wx) < 0.01)
THROWM(Base::ValueError,"Points are collinear");
double x = (w0*p1.x + w1*p2.x + w2*p3.x)/wx;