Fun with Fractals: Snowflakes and Ferns
Hanno
Posts: 1,130
Hi,
I've had some fun exploring fractals with 12Blocks.
The "Fern" program was inspired by this:
http://www.home.aone.net.au/~byzantium/ferns/fractal.html
It continually calculates new x,y coordinates according to a simple function. The result is a beautiful fern leaf!
The "Snowflakes" program calculates "Koch Flakes" based on:
http://en.wikipedia.org/wiki/Koch_snowflake
This shape is drawn using a simple recursive algorithm. The result is a beautiful snowflake. The program animates several flakes falling as they "twinkle".
Video/photos coming soon...
Hanno
I've had some fun exploring fractals with 12Blocks.
The "Fern" program was inspired by this:
http://www.home.aone.net.au/~byzantium/ferns/fractal.html
It continually calculates new x,y coordinates according to a simple function. The result is a beautiful fern leaf!
The "Snowflakes" program calculates "Koch Flakes" based on:
http://en.wikipedia.org/wiki/Koch_snowflake
This shape is drawn using a simple recursive algorithm. The result is a beautiful snowflake. The program animates several flakes falling as they "twinkle".
Video/photos coming soon...
Hanno
Comments
When the SA article came out this sharp dude quickly got the Mandelbrot images which 'distracted' many engineers and others; he'd even let it run overnight to get some high magnifications of areas of interest. An amazing set of fractals soon were being made public and I recall leaves and other interesting images that could be generated. Mathematics can produce interesting patterns for us humans.
Hope this isn't too off-subject.
I discovered that if you were writing in assembler under MSDOS, which uses the 32 bit 386 CPU in 16 bit "real" mode" you could put a prefix byte in front of instructions that would make just that instruction operate in 32 bit mode.
Wow, what a discovery, 32 bit arithmetic ops under MDSOS. Now we can make some faster renderings.
Result was that said military wireless project development pretty much stopped for two weeks as the entire team got hooked on the idea and our lunch breaks got longer and longer....:)
Yes, Mandelbrot brings back good memories
Amazing to think what complexity lives beneath a simple formula.
I used to wait for hours to zoom to another Mandelbrot set- now it's real time!
See attached for photos of the fern and snowflake as rendered by the propeller running the 12block programs above...
Hanno
Hanno
As you brought up fractals and I happen to be playing with float32 for the first time on the Prop that idea did cross my mind.
But then, wouldn't it be better to use 64bit fixed point arithmetic for maximum zoom without loss of detail?
Hanno
ps- Here's the windows version of fractint: http://www.nahee.com/spanky/pub/fractals/programs/ibmpc/windows/WinFract_20-04-p09.zip
This has to be done in such a way that it can spread over multiple Propellers. There are many three Prop TriBlades out there and Humainoid has 40 in the Ultra Spark.
I seem to remeber that in the Transputer days they used to farm out the work line by line.
I suppose I'll have to give it a go. I'm thinking 32bit fixed integer math running in pasm. To keep it simple, a single cog looping through the pixels and handling the user interface with another cog displaying the video. That leaves 6 cogs or 120mips for mandelbrot. Could be easily scaled up with multiple props.
Hanno
http://forums.parallax.com/showthread.php?t=126429
Potatoehead has already gotten it to work with his hi-color display!
Humanoido is looking at getting it to work with his 40-Prop "super"computer.