> var radius = Math.pow( a * c, angle ); Ooops, should be: var radius = a * Math.pow( c, angle );
And angle is in radians, so Math.PI * 2 is a full circle. It's what Math.atan2() gives you (not so incidentally), so if you want to tie it to a mouse pos... Mark On 9/11/07, Mark Winterhalder <[EMAIL PROTECTED]> wrote: > Hi Jason, > > to translate the Wikipedia page: > > var c = Math.pow( (1 + Math.sqrt( 5 )) / 2, 2 / Math.PI ); > var a = aPositiveRealNumber; // like, 1 > > // in your loop: > var radius = Math.pow( a * c, angle ); > var x = Math.cos( angle ) * radius; > var y = -Math.sin( angle ) * radius; > > You keep incrementing angle, obviously. > If the spiral seems to go into the wrong direction, remove the minus > in the y line. Adjust 'a' to in-/decrease growth. > > HTH, > Mark > > > > On 9/10/07, Merrill, Jason <[EMAIL PROTECTED]> wrote: > > \I'm no math whiz, does anyone know how I can draw a golden spiral and > > position and move sprites/movieClips along a golden spiral path? > > > > What is a golden spiral? > > http://en.wikipedia.org/wiki/Golden_spiral > > "In geometry, a golden spiral is a logarithmic spiral whose growth factor b > > is related to φ, the golden ratio. Specifically, a golden spiral gets wider > > (or further from its origin) by a factor of φ for every quarter-turn it > > makes." > > > > Or a spiral shape in general? I want to position a point along the spiral > > based on numerical data. Then as things change, animate the object along > > the path of the spiral. I need this to be dynamic, not hand-drawn guide > > layers. Anyone know how to translate this math to Actionscript? > > > > Thanks, > > > > > > Jason Merrill > > Bank of America > > GT&O Learning & Leadership Development > > eTools & Multimedia Team > > > > > > > > _______________________________________________ > > Flashcoders@chattyfig.figleaf.com > > To change your subscription options or search the archive: > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > Brought to you by Fig Leaf Software > > Premier Authorized Adobe Consulting and Training > > http://www.figleaf.com > > http://training.figleaf.com > > >
_______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com