```
\startluacode
function mp.mira_attractor(x, y, iter)
local a = 0.4995
local f = function (n)
return a*n + 2*(1-a)*(n/(1+n*n))^2
end
mp.print("image(")
for i = 1, iter do
local w = x
x = y + f(w)
y = -0.9998*w + f(x)
mp.fprint("drawdot (%f, %f);", x, y)
i = i + 1
end
mp.print(")")
end
\stopluacode
\starttext
\startMPpage
picture nice;
nice := lua.mp.mira_attractor(12,0,20000) xsized 10cm;
draw nice withpen pencircle scaled 1 withcolor darkred;
\stopMPpage
\stoptext
```