Draw a sphere: Difference between revisions

Content added Content deleted
m (→‎{{header|C}}: floating math, duh)
Line 39: Line 39:
x = i + .5;
x = i + .5;
for (j = floor(-2 * R); j <= ceil(2 * R); j++) {
for (j = floor(-2 * R); j <= ceil(2 * R); j++) {
y = j / 2 + .5;
y = j / 2. + .5;
if (x * x + y * y <= R * R) {
if (x * x + y * y <= R * R) {
vec[0] = x;
vec[0] = x;