comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Fractal in IDL!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Fractal in IDL! [message #68371] Thu, 29 October 2009 11:32 Go to previous message
rtk is currently offline  rtk
Messages: 22
Registered: September 2008
Junior Member
On Oct 28, 9:15 pm, sathya <sathya.s...@gmail.com> wrote:
> Hi,
>
> I am trying to create a fractal set in IDL. I know that a Mandelbrot
> set follows the below mentioned function,i.e.
>
> f(x) = x^2 - c
>
> where, x - is a complex number, c - constant
> and the range for x-axis is [-1.5, 1.5].
>
> In a similar way, can anyone gime me the function for anyother fractal
> or Koch snowflake. If I am not wrong, does it follow the given
> function?
>
> a =( 1/2 )+ ( i/SQRT(12) )
>
> Thanks,
> Sathya!

Perhaps the easiest way to draw fractals of various kinds is to use
the IFS ('Iterated Function System') approach. Email me if you want
IDL code that can do that.

Also, the Sierpinski triangle is perhaps the simplest of all fractals
to generate. Here's BASIC code from the 80s to do it. I leave
translation to IDL as an exercise for the reader :)

10 HOME:HGR2:HCOLOR=3: REM This just turns on the graphics and sets
the color
20 X(1)=0:Y(1)=191:X(2)=140:Y(2)=0:X(3)=278:Y(3)=191: REM Triangle
corners
30 X=X(1):Y=Y(1): REM A starting point
40 N = INT(3*RND(1))+1: X=INT(0.5*(X+X(N))): Y=INT(0.5*(Y+Y(N))): REM
The magic is here
50 HPLOT X,Y:GOTO 40: REM Plot the new point and continue

Have fun!

Ron
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Fractal in IDL!
Next Topic: TLB_Frame_Attr weirdness/compile issue?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 09:47:53 PDT 2025

Total time taken to generate the page: 0.96088 seconds