On 10/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Ok
i'm sure this is elementary for any math whizzes out there, but this is my 
problem:

Given an initial point x1,y1 on the cicumference of a circle, how do we 
determine point 2(x2,t2) and point 3 (x3,y3) if point 2 and 3 are 120 and 240 
degrees respectively removed from point 1. ie all 3 points are 120 degrees 
apart.

If the center of the circle is at (0, 0), then you can just rotate
point p1 by 120 and 240 degrees respectively, to get p2 and p3:

var angle = 120 / (180 * Math.PI); // ...or 240 instead of 120
var sin = Math.sin( angle );
var cos = Math.cos( angle );
x2 = cos * x1 - sin * y1;
y2 = sin * x1 + cos * y1;

HTH,
Mark
_______________________________________________
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