bufferDistanceError static method

double bufferDistanceError(
  1. int quadSegs
)

Computes the maximum distance error due to a given level of approximation to a true arc.

@param quadSegs the number of segments used to approximate a quarter-circle @return the error of approximation

Implementation

static double bufferDistanceError(int quadSegs) {
  double alpha = math.pi / 2.0 / quadSegs;
  return 1 - math.cos(alpha / 2.0);
}