PDA

Click to See Complete Forum and Search --> : spiral that grows by 1.618



perryj
07-09-2002, 11:57 AM
I need some actionscript that will make a "golden section" spiral. I'd love it if I could have the spiral drawn rather than just appear. I'm relatively new to Flash, please - any help is greatly appreciated.

reference link follows:
http://dgleahy.com/dgl/p14.html

ericlin
07-14-2002, 10:45 AM
I dont know what is that 1.618 means. The reference web that you included here just scared me. I did not read it.

Well, you want a spiral animation, so we do animation. If the whole 360 degree (or 2*Math.PI) is divided into 20, then we get a sub-zoom-factor f, that Math.pow(f,20) will be the zoom factor that we need for the radius of outer circle/the radius of inner circle. In the fla below I divide a circle as 60 parts.

I can not solve the equation, so I just made an approximation function. Here is the fla I draw mulitple lines to simulate the picture in that web page.

http://dr_ericlin.tripod.com/forum/spiral5.html
http://dr_ericlin.tripod.com/forum/spiral5.zip

perryj
07-14-2002, 12:23 PM
Eric,
The swf you posted looks like exactly what I need, but I can't download the .zip file. Tripod won't allow. You can e-mail it to me

perry@inkandpaper.org

Thanks for your help

White Bird
07-27-2007, 08:41 PM
Hi
I found an old post of yours in the flashkit forum with a link to a golden mean spiral - but the link no longer works.
Would you be good enough to send it to me?
Many thanks in advance
Dan Vantari
wb@bookoffire.net

Heres the post


I dont know what is that 1.618 means. The reference web that you included here just scared me. I did not read it.

Well, you want a spiral animation, so we do animation. If the whole 360 degree (or 2*Math.PI) is divided into 20, then we get a sub-zoom-factor f, that Math.pow(f,20) will be the zoom factor that we need for the radius of outer circle/the radius of inner circle. In the fla below I divide a circle as 60 parts.

I can not solve the equation, so I just made an approximation function. Here is the fla I draw mulitple lines to simulate the picture in that web page.

http://dr_ericlin.tripod.com/forum/spiral5.html
http://dr_ericlin.tripod.com/forum/spiral5.zip

realMakc
07-28-2007, 05:21 AM
his code has very old line drawing method; it can be done much simpler now:
// as per http://en.wikipedia.org/wiki/Golden_spiral
function spiral (a, t) {
var f = 0.5 * (1 + Math.sqrt (5));
var c = Math.pow (f, 2 / Math.PI);

return a * Math.pow (c, t);
}

this.lineStyle (1);
for (var t = 0; t < 23; t += 0.1) {
var r = spiral (1, t);
var x = Stage.width/2 + r * Math.sin (t);
var y = Stage.height/2 + r * Math.cos (t);
if (t == 0) {
this.moveTo (x, y);
}
this.lineTo (x, y);
}

White Bird
07-28-2007, 09:13 PM
Thanks thats a great beginning and the Wikipedia article is interesting.
WB

Eager Beaver
07-29-2007, 03:01 AM
Here is another similar code for a spiral.
Please see the attached FLA. (F8).

White Bird
07-30-2007, 08:36 PM
Thanks Eager Beaver itsd good to have one that draws the line.

realMakc
07-31-2007, 06:59 AM
here (http://flashmove.com/forum/showpost.php?p=116341&postcount=20) goes my spiral code spin-off.

White Bird
07-31-2007, 08:40 AM
Oh very nice !
The code is way beyond me but I like the shrinking spiral.
Whats the black semi circular shape there for?
Cool anyway

WB

realMakc
07-31-2007, 08:48 AM
Whats the black semi circular shape there for??

Verrou
08-08-2007, 06:42 AM
Fibonacci Sequence <3 From the Da Vinci Code :P We use it alot in maths atm.