diff --git a/libs/kimath/src/trigo.cpp b/libs/kimath/src/trigo.cpp index c61b091041..02b30ab32f 100644 --- a/libs/kimath/src/trigo.cpp +++ b/libs/kimath/src/trigo.cpp @@ -386,13 +386,19 @@ const VECTOR2D CalcArcCenter( const VECTOR2D& aStart, const VECTOR2D& aMid, cons return center; } - // Prevent div=0 errors + // Prevent div-by-0 errors if( xDelta_21 == 0.0 ) xDelta_21 = std::numeric_limits::epsilon(); if( xDelta_32 == 0.0 ) xDelta_32 = -std::numeric_limits::epsilon(); + if( yDelta_21 == 0.0 ) + yDelta_21 = std::numeric_limits::epsilon(); + + if( yDelta_32 == 0.0 ) + yDelta_32 = -std::numeric_limits::epsilon(); + double aSlope = yDelta_21 / xDelta_21; double bSlope = yDelta_32 / xDelta_32;