|
Re: mandelbrot [message #70515 is a reply to message #70443] |
Fri, 16 April 2010 07:25  |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
On Apr 16, 9:44 am, Dave Poreh <d.po...@gmail.com> wrote:
> On Apr 15, 7:16 am, Paolo <pgri...@gmail.com> wrote:
>
>
>
>> On Apr 15, 4:39 am, Dave Poreh <d.po...@gmail.com> wrote:
>
>>> On Apr 14, 8:20 am, Paolo <pgri...@gmail.com> wrote:
>
>>>> On Apr 14, 7:49 am, a <oxfordenergyservi...@googlemail.com> wrote:
>
>>>> > I was looking for a mandelbrot set generator for idl to show off idl
>>>> > to someone
>
>>>> > I found thishttp://rosettacode.org/wiki/Mandelbrot_set#IDLbutI
>>>> > remember seeing a more efficient version (just a few lines) once.
>
>>>> > anybody got a mandelbrot set generator in the fewest lines?
>
>>>> > Russ
>
>>>> This comes pretty close to a minimum set of commands:
>
>>>> ;setup coordinates
>>>> x=findgen(512)/511*4-2
>>>> xx=x#(x*0+1)
>>>> zz=complex(xx,transpose(xx))
>>>> cc=zz
>
>>>> ;compute set for n=100 iterations
>>>> niter=100
>>>> for i=0,niter-1 do zz=zz*zz+cc
>>>> inside=where(abs(zz) LE 2,complement=outside)
>
>>>> ;this just for display
>>>> mand=xx*0
>>>> mand[inside]=1
>>>> tvscl,mand
>
>>>> Ciao,
>>>> Paolo
>
>>> Any help with KOCH curve?
>
>> what have you tried? how did it fail?
>
>> Paolo
>
> I just want to know how we could produce it (KOCH curve) in IDL.
> Dave
You write a procedure that, given two points a and b returns
5 points a,x,y,z,b such that x is one third of the way from a to b,
z is 2 thirds of the way, and y builds an equilateral triangle with
x and z. When that is ready and working, you modify it to recursively
call itself. It's pretty straightforward.
Ciao,
Paolo
|
|
|