Page 1 of 1

Fractals (Julia set)

Posted: Thu Oct 25, 2012 2:35 pm
by antiloquax
I have been playing around with generating fractals in Scratch.
This is a Julia set image I have made. I can post the code if anyone is interested.

Re: Fractals (Julia set)

Posted: Thu Oct 25, 2012 5:45 pm
by pygmy_giant
wow - thats beautiful!

Re: Fractals (Julia set)

Posted: Thu Oct 25, 2012 8:52 pm
by tenochtitlanuk
I for one would like to see the code, having written equivalents in other languages & knowing how long they may take to execute! Well done anyway.

Re: Fractals (Julia set)

Posted: Thu Oct 25, 2012 11:49 pm
by The1Power
The fractal is awesome. My son & I both think it is cool. I would also like to see the code.
Thanks for sharing.
Cheers. :D

Re: Fractals (Julia set)

Posted: Fri Oct 26, 2012 3:02 pm
by antiloquax
Ok, here is the code. The one I posted took all day!
Here are some pairs of numbers to give the program.
Julia Set
Real:-0.4
Im:0.6

Real:-0.8
Im:0.156

Real:-0.74543
Im:0.11301

Real:-0.1
Im:0.651

I'd recommend with setting the max iterations to about 20.
Try zoom = 1 and dot size 4. If you are really patient, you can try for a higher resolution image.

mark

Image

You can get the script on the Scratch website: (I am "racypy")
http://scratch.mit.edu/projects/racypy/2859934

Re: Fractals (Julia set)

Posted: Fri Oct 26, 2012 3:38 pm
by antiloquax
julia3.gif
julia3.gif (22.58 KiB) Viewed 2869 times
This is the sort of image I get when running at dot size 4. It is slow!

Re: Fractals (Julia set)

Posted: Sat Oct 27, 2012 5:18 pm
by antiloquax
scratch_top.png
scratch_top.png (57.82 KiB) Viewed 2824 times
Just for the record, this is my Pi running this program. As you can see, Scratch is using about 60% of the CPU.