[Fun] Spiral animation

stéphane ducasse ducasse at iam.unibe.ch
Sun Jun 20 13:51:14 UTC 2004


Really cool.
I tried it in my last 3.7 image and it could not stopped strange.

Stef
On 20 juin 04, at 14:34, Markus Gaelli wrote:

> Hi folks,
>
> I thought some of you might like it...
> I stole the formula at the bottom from Wolframs New Kind of Science:  
> http://www.wolframscience.com/nksonline/page-411?firstview=1
>
> For an online version of the spirals see:  
> http://www.squeakland.org/project.jsp?http://www.emergent.de/pub/ 
> smalltalk/squeak/projects/galaxies.001.pr
>
> I find it amazing, that sunflowers (anAngle =  137.5 = 360*(1-phi)),  
> yin-yang, and lots of other interesting :-/ symbols can be made out of  
> this simple formula (which I made a bit more complex for aesthetic  
> reasons).
>
> | backgroundColor  leafSize anExtent aCanvas numbersOfLeafs someColors  
> aPoint |
> 	backgroundColor _ Color blue muchDarker.
> 	leafSize _ 60 @ 60.
> 	anExtent _ Display extent y @ Display extent y.
> 	aCanvas _ BalloonCanvas extent: anExtent.
> 	numbersOfLeafs _ 200.
> 	someColors _ Color wheel: numbersOfLeafs.
> 	[Display fillColor: backgroundColor.
> 	0
> 		to: 360
> 		by: 0.1
> 		do: [:anAngle |
> 			(1 to: numbersOfLeafs)
> 				do: [:anInt |
> 					aPoint _ (anInt sqrt * ((anInt * anAngle degreesToRadians) cos @  
> (anInt * anAngle degreesToRadians) sin) * (anExtent - leafSize /  
> numbersOfLeafs sqrt) + (anExtent - leafSize) / 2) rounded.
> 					aCanvas
> 						fillOval: (aPoint extent: (leafSize * (numbersOfLeafs - anInt) /  
> numbersOfLeafs) rounded)
> 						color: (someColors at: anInt)].
> 			aCanvas showAt: (Display center - (anExtent / 2)) rounded.
> 			aCanvas fillColor: backgroundColor].
> 	[Sensor anyButtonPressed] whileFalse.
> 	nil]
> 		ensure: [Display restore]
>
> Enjoy,
>
> Markus
>
>




More information about the Squeak-dev mailing list