|
|
> If the functions supported true recursion it would be rather easy:
>
> #declare MandIter =
> function(n, Re, Im, Zr, Zi)
> { select(n>50 | Zr*Zr+Zi*Zi > 2, 0,
> MandIter(n+1, Re, Im, Zr*Zr-Zi*Zi+Re, 2*Zr*Zi+Im), n/50)
> }
>
> #declare Mandel = function(Re, Im) { MandIter(0, Re, Im, Re, Im) }
>
> (Now you could do for example "pigment { function { Mandel(x,y) }
... }".)
And you can! Looks good. =)
(I find it impressive that you could do that from memory without actually
checking if it worked... though I think the > 2 should be > 4)
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|