Anonymous user
Draw a sphere: Difference between revisions
→{{header|Scala}}
Line 4,089:
}
for (i <- math.floor(-r).toInt to Math.ceil(r).toInt; x = i + .5)
println(
(for (j <- math.floor(-2 * r).toInt to Math.ceil(2 * r).toInt; y = j / 2.0 + .5)
yield if (x * x + y * y <= r * r) {
}
|