POV-Ray : Newsgroups : povray.general : Re: Difference Small objects and Glass Cube : Re: Difference Small objects and Glass Cube Server Time
2 Aug 2024 16:27:53 EDT (-0400)
  Re: Difference Small objects and Glass Cube  
From: Slime
Date: 15 Sep 2004 20:00:17
Message: <4148d791$1@news.povray.org>
>   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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.