Would anyone have a function, class, formula, idea whatever that would
allow me to calculate X and Y values to place an "n" number of movie
clips evenly spaced around an ellipse/oval shape?  The number of clips
can vary based on external data.  The ellipse would also have to be
calculated I suppose, but not actually drawn - the representation of it
would be a separate graphic.

'evenly spaced' is a slightly ambiguous phrase. It could either mean that they are spaced with even angles (meaning that physically the clips at the 'pointy end' of the ellipse would be closer to each other) or that they are spaced with equal arc lengths, or various other metrics.

I always find it easiest to think of an ellipse as a circle transformed by a stretch and rotate. So I'd do it something like this:

for an ellipse with short radius (semiminor axis) a and long radius (semimajor axis) b, centred on c, pointed along the unit vector v: first place your clips evenly spaced around a unit circle: if there are N clips then place clip i at (sin(i*2*pi/N), cos(i*2*pi/N)) then stretch the positions: multiply the x-axis by a and y-axis by b: (a*sin(i*2*pi/N), b*cos(i*2*pi/N))
then rotate: move to i[2]*v+i[1]*normal(v)
then translate: add c to each point.

HTH
Danny
_______________________________________________
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

Reply via email to