Julia set: Difference between revisions
Content added Content deleted
(Kotlin entry) |
m (→{{header|Julia}}: code simplifications) |
||
Line 602:
<lang julia>using Images
const w, h = 800, 600
const img = Array(
const maxIter = 50
const c = -0.8+0.156im
@inline function hsv2rgb(h, s, v)
const c = v * s
const x = c * (1 - abs(((h/60) % 2) - 1))
const m = v - c
const r,g,b =
if h < 60
(c, x, 0)
Line 628:
end
end
Line 643 ⟶ 639:
end
r,g,b = hsv2rgb(i / maxIter * 360, 1, i > 1 ? 1 : 0)
img[y,x
end
end
save("JuliaSet.png",
=={{header|Kotlin}}==
|