I just spun this up right now, it's untested. (Robert Penner's book is
great).

-mL
http://knowledge.lapasa.net


/*
 * @param       nodes           The number of objects sitting on the circle
 * @param       radius  The radius of the circle
 * @return      an array of (x,y) objects
 */
function getCirclePositions(nodes:Number, radius:Number)
{
        var thetaIncrement:Number = Math.round(360/nodes);
        var currentTheta:Number = thetaIncrement;

        var positionsArray:Array = new Array();

        while (currentTheta <= 360)
        {
                var tmpX:Number = radius * Math.round(Math.cos(currentTheta *
Math.PI/180));
                var tmpY:Number = radius * Math.round(Math.sin(currentTheta *
Math.PI/180));

                positionsArray.push({x:tmpX, y:tmpY});
                currentTheta += thetaIncrement;
        }
        return positionsArray;
}

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Kevin
Aebig
Sent: Wednesday, October 25, 2006 6:10 PM
To: 'Flashcoders mailing list'
Subject: [Flashcoders] Space Clips in Circle


Hey all,



My goal is to space 12 clips in a circle evenly based on a radius. I'm
officially stumped after messing around with it for 3 days with no success.



Any help or insight appreciated.



Cheers,



!k

_______________________________________________
[email protected]
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



_______________________________________________
[email protected]
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