On 10/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Another way of stating my problem:


Given an initial angle, and a circle with radius r, how do you determine the 
x,y coordinates of the point p1 on the circumference of this circle...assuming 
the circle's center is at 0,0.?

Just use the code I posted in reply to "Elementary Trig" (part 1). It
works for any angle, not just 120 and 240 degrees.

Your "initial angle" needs to be between (the vector) p1 and
something. That something is often (1, 0) -- one unit along the X
axis. So, use that for x1, y1 in the code I posted, and your vector
will be (x2, y2), or put differently, (Math.cos( initialAngle ),
-Math.sin( initialAngle )) if initialAngle is the angle between your
initial point and the X axis.
However, it's only one unit (one pixel) from the center, not the
radius r. You still need to scale it, simply multiply x and y by r.

In short:

x = Math.cos( angle ) * r;
y = -Math.sin( angle ) * r;

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