A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: spiral that grows by 1.618

  1. #1
    Junior Member
    Join Date
    Jul 2002
    Posts
    2
    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

  2. #2
    Senior Member
    Join Date
    May 2001
    Posts
    1,838
    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

  3. #3
    Junior Member
    Join Date
    Jul 2002
    Posts
    2

    can't download from tripod

    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

  4. #4
    Junior Member
    Join Date
    Sep 2004
    Location
    Byron Bay NSW Australia
    Posts
    15

    Hi - could you please send me this file that you made?

    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

    Quote Originally Posted by ericlin
    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
    Try to have as much time outdoors in nature as you do at a computer and have a great day.
    PS Want the most important health supplement ever? Heard of Glyco-nutrients? Ask me.

  5. #5
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927
    his code has very old line drawing method; it can be done much simpler now:
    Code:
    // 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);
    }
    who is this? a word of friendly advice: FFS stop using AS2

  6. #6
    Junior Member
    Join Date
    Sep 2004
    Location
    Byron Bay NSW Australia
    Posts
    15
    Thanks thats a great beginning and the Wikipedia article is interesting.
    WB
    Try to have as much time outdoors in nature as you do at a computer and have a great day.
    PS Want the most important health supplement ever? Heard of Glyco-nutrients? Ask me.

  7. #7
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    Here is another similar code for a spiral.
    Please see the attached FLA. (F8).
    Last edited by Eager Beaver; 08-19-2007 at 02:17 PM.
    <signature removed by admin>

  8. #8
    Junior Member
    Join Date
    Sep 2004
    Location
    Byron Bay NSW Australia
    Posts
    15
    Thanks Eager Beaver itsd good to have one that draws the line.
    Try to have as much time outdoors in nature as you do at a computer and have a great day.
    PS Want the most important health supplement ever? Heard of Glyco-nutrients? Ask me.

  9. #9
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927
    here goes my spiral code spin-off.
    who is this? a word of friendly advice: FFS stop using AS2

  10. #10
    Junior Member
    Join Date
    Sep 2004
    Location
    Byron Bay NSW Australia
    Posts
    15
    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
    Try to have as much time outdoors in nature as you do at a computer and have a great day.
    PS Want the most important health supplement ever? Heard of Glyco-nutrients? Ask me.

  11. #11
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927
    Quote Originally Posted by White Bird
    Whats the black semi circular shape there for?
    ?
    who is this? a word of friendly advice: FFS stop using AS2

  12. #12
    Member
    Join Date
    Jul 2007
    Posts
    28
    Fibonacci Sequence <3 From the Da Vinci Code :P We use it alot in maths atm.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center