145 double increment, halfAngle, maxErr;
146 if ( max_deviation <= 0 )
148 lwerror(
"lwarc_linearize: max deviation must be bigger than 0, got %.15g", max_deviation);
176 maxErr = max_deviation;
177 if ( maxErr > radius * 2 )
181 "lwarc_linearize: tolerance %g is too big, "
182 "using arc-max 2 * radius == %g",
187 halfAngle = acos( 1.0 - maxErr / radius );
190 if ( halfAngle != 0 )
break;
191 LWDEBUGF(2,
"lwarc_linearize: tolerance %g is too small for this arc"
192 " to compute approximation angle, doubling it", maxErr);
195 increment = 2 * halfAngle;
197 "lwarc_linearize: maxDiff:%g, radius:%g, halfAngle:%g, increment:%g (%g degrees)",
202 increment * 180 / M_PI);
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.