antiloquax
Posts: 406
Joined: Sun Nov 20, 2011 11:37 am
Contact: Website

Fractals (Julia set)

Thu Oct 25, 2012 2:35 pm

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.
Attachments
julia2.PNG
julia2.PNG (16.11 KiB) Viewed 2494 times

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Fractals (Julia set)

Thu Oct 25, 2012 5:45 pm

wow - thats beautiful!

tenochtitlanuk
Posts: 156
Joined: Fri Jul 06, 2012 8:51 pm
Location: Taunton, Somerset, UK
Contact: Website

Re: Fractals (Julia set)

Thu Oct 25, 2012 8:52 pm

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.

The1Power
Posts: 2
Joined: Thu Oct 25, 2012 11:38 pm
Location: Phoenix, Arizona, USA

Re: Fractals (Julia set)

Thu Oct 25, 2012 11:49 pm

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

antiloquax
Posts: 406
Joined: Sun Nov 20, 2011 11:37 am
Contact: Website

Re: Fractals (Julia set)

Fri Oct 26, 2012 3:02 pm

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

antiloquax
Posts: 406
Joined: Sun Nov 20, 2011 11:37 am
Contact: Website

Re: Fractals (Julia set)

Fri Oct 26, 2012 3:38 pm

julia3.gif
julia3.gif (22.58 KiB) Viewed 2427 times
This is the sort of image I get when running at dot size 4. It is slow!

antiloquax
Posts: 406
Joined: Sun Nov 20, 2011 11:37 am
Contact: Website

Re: Fractals (Julia set)

Sat Oct 27, 2012 5:18 pm

scratch_top.png
scratch_top.png (57.82 KiB) Viewed 2382 times
Just for the record, this is my Pi running this program. As you can see, Scratch is using about 60% of the CPU.

Return to “Scratch”