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: | 113 |
Nodes: | 8 (1 / 7) |
Uptime: | 115:52:41 |
Calls: | 2,501 |
Files: | 8,689 |
Messages: | 1,922,435 |