Jump to content

Barnsley fern: Difference between revisions

m
Line 1,720:
x::Float64
y::Float64
age::Int
fern::Matrix{RGB}
function BarnsleyFern(width, height)
f = new(width, height, RGB(0.0, 1.0, 0.0), RGB(1.0, 1.0, 1.0), 0.0, 0.0, 0,
[RGB(0.0, 0.0, 0.0) for x in 1:width, y in 1:height])
x, y = scale(f)
Line 1,747 ⟶ 1,746:
f.fern[Int(trunc(newx)) + 1, Int(trunc(newy)) + 1] = f.color
end
f.age += iterations
end
 
4,105

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.