[Fun] Spiral animation
ducasse at iam.unibe.ch
Sun Jun 20 14:50:26 UTC 2004
ok I saw.
I was comfused by your last line.
This would be a really nice screen saver
On 20 juin 04, at 16:11, Markus Gaelli wrote:
> Hi Stef,
>> Really cool.
> Thanks. :-)
>> I tried it in my last 3.7 image and it could not stopped strange.
> It takes a while, and I did not make it stoppable.
> I also thought it was stoppable when I roughly scanned the source that
> I programmed some while ago.
> I guess it should be, but the idea was to keep it simple to understand
> with the for-loop, and I do not know how to combine that with an early
>> 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:
>>> For an online version of the spirals see:
>>> 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.
>>> 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.
>>> 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.
>>> ensure: [Display restore]
More information about the Squeak-dev