CoffeeScript Ikeda Map
canvas = document.querySelector "canvas"
c = canvas.getContext "2d"
locX = 120
locY = 400
xn1 = xn = yn1 = yn = tn = 0
u = .7
steps = 10
iterations = 200
scale = 180
c.fillStyle = "black"
c.fillRect 0, 0, canvas.width, canvas.height
c.fillStyle = "rgba(255,255,255,0.2)"
run = setInterval ->
clearInterval run if u > 1
i = 0
while i < steps
u += 0.00015
j = 0
while j < iterations
xn = xn1
yn = yn1
tn = 0.4 - (6 / (1 + xn * xn + yn * yn))
xn1 = 1 + u * (xn * Math.cos(tn) - yn * Math.sin tn)
yn1 = u * (xn * Math.sin(tn) + yn * Math.cos tn)
c.fillRect locX + xn1 * scale, locY + yn1 * scale, 1, 1
j++
i++
, 30
I do quite miss CoffeeScript sometimes… here is an old codepen of the Ikeda Map:
See the Pen Ikeda Map by Zevan Rosser (@ZevanRosser) on CodePen.