Barnsley fern: Difference between revisions
Content added Content deleted
Line 1,721: | Line 1,721: | ||
fern::Matrix{RGB} |
fern::Matrix{RGB} |
||
function BarnsleyFern(width, height) |
function BarnsleyFern(width, height) |
||
f = new(width, height, RGB(0.0, 1.0, 0 |
f = new(width, height, RGB(0.0, 1.0, 0.0), 0.0, 0.0, |
||
[RGB(0.0, 0.0, 0.0) for x in 1:width, y in 1:height]) |
[RGB(0.0, 0.0, 0.0) for x in 1:width, y in 1:height]) |
||
cx = Int(floor(2.182 * (f.width - 1) / 4.8378) + 1) |
cx = Int(floor(2.182 * (f.width - 1) / 4.8378) + 1) |