Consider circles which are centered on a pixel and have integer
radii. If such a circle with radius r is rendered using either the
midpoint algorithm or Breshenham's circle algorithm, it can be shown
that the number of pixels drawn, N, is given by
N = 8 * floor((sqrt(2)/2)*r) + 4
Depending on the value of r,
8 * ((sqrt(2)/2)*r - 1) + 4 < N <= 8 * ((sqrt(2)/2)*r) + 4
or
4*sqrt(2)*r - 4 < N <= 4*sqrt(2)*r + 4
So a "nominal" value for N would be...
4*sqrt(2)*r
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 225:04:44 |
Calls: | 6,623 |
Calls today: | 5 |
Files: | 12,171 |
Messages: | 5,318,597 |