/* ** b r e s . c ** ** perry s. kivolowitz - ihnp4!ptsfa!well!perry ** ** not to be distritbuted for commercial use. any distribution ** must included this notice, please. ** ** generate radial displacements according to bresenham's circle ** algorithm. suitable for running twice, giving a fast spherical ** surface. ** */ bres(r , array) register short *array; register r; { register x , y , d; x = 0; y = r; d = 3 - 2 * r; while (x < y) { *(array + r - y) = x; *(array + r - x) = y; *(array + r + y - 1) = x; *(array + r + x - 1) = y; if (d < 0) d += 4 * x + 6; else d += 4 * (x - y--) + 10; x++; } if (x == y) { *(array + r - y) = x; *(array + r + y - 1) = x; } }