
Modeling of a Voxelated Surface 245
Algorithm 16: Algo rithm DCS.
Algorithm DCS (int r)
1. int i ← 0, j ← r, s ← 0, w ← r − 1
2. int l ← 2w
3. while (j > i) do
4. include
8 sym points (i, j)
5. s ← s + i
6. i ← i + 1
7. s ← s + i while (s 6 w)
8. w ← w + l
9. l ← l − 2
10. j ← j − 1
Lemma 7.4. The number of perfect squares in a closed interval [v, w] is at
most one more than the number of perfect squares in the preceding closed
interval [u, v − 1] of equal length, where the intervals are taken from the non-
negative integer axis.
Now, from Lemma 7.3 it is obvious that the length of the interval contain-
ing the squares of abscissae (of grid points of C
Z
1
(o, ...