157 double increment, halfAngle, maxErr;
158 if ( max_deviation <= 0 )
160 lwerror(
"lwarc_linearize: max deviation must be bigger than 0, got %.15g", max_deviation);
188 maxErr = max_deviation;
189 if ( maxErr > radius * 2 )
193 "lwarc_linearize: tolerance %g is too big, "
194 "using arc-max 2 * radius == %g",
199 halfAngle = acos( 1.0 - maxErr / radius );
202 if ( halfAngle != 0 )
break;
203 LWDEBUGF(2,
"lwarc_linearize: tolerance %g is too small for this arc"
204 " to compute approximation angle, doubling it", maxErr);
207 increment = 2 * halfAngle;
209 "lwarc_linearize: maxDiff:%g, radius:%g, halfAngle:%g, increment:%g (%g degrees)",
214 increment * 180 / M_PI);
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.