Re: [Flashcoders] Intersection on circle based on angle

2009-03-17 Thread Matt S.
This Tutorial proved handy for me: http://www.codylindley.com/Tutorials/trigonometry/ On Tue, Mar 17, 2009 at 9:17 AM, Eric E. Dolecki edole...@gmail.com wrote: I've done this before but can't find my file(s). I am currently googling but haven't found the answer yet (I'm sure it's out there,

RE: [Flashcoders] Intersection on circle based on angle

2009-03-17 Thread Merrill, Jason
In AS3, Point.polar() Jason Merrill Bank of America | Learning Performance Solutions Instructional Technology Media Monthly meetings on the Adobe Flash platform for rich media experiences - join the Bank of America Flash Platform Community -Original Message- From:

RE: [Flashcoders] Intersection on circle based on angle

2009-03-17 Thread Merrill, Jason
I have the angle (say 0 degrees). The length would then be pixels from the center (ie. radius)? Yes, radius is pixel distance from starting point (in your case, the center point of the circle). Then you just need to convert angle to radians and you're good to go. var cartesianPoint:Point =

Re: [Flashcoders] Intersection on circle based on angle

2009-03-17 Thread Eric E. Dolecki
Okay this thing may be the coolest thing I've seen in a while. However it's acting funny. If I do this: var coord:Point = Point.polar( _radius, angle ); It works great. But I am after a point further out than _radius. So naturally I pad it a little... var coord:Point = Point.polar( _radius +

Re: [Flashcoders] Intersection on circle based on angle

2009-03-17 Thread Glen Pike
Hi, You have the position of the point in polar coordinates (radius, angle), so you want to get the point in cartesian (x, y) - this function converts it. You need the angle in radians though. It's shorthand for: x = radius * sin(theta); y = radius * cos(theta); Where theta

Re: [Flashcoders] Intersection on circle based on angle

2009-03-17 Thread Eric E. Dolecki
sorry - found my pilot error. this ROCKS - thanks, I never would have found that. LOTS of cool stuff in the Point class. On Tue, Mar 17, 2009 at 10:34 AM, Eric E. Dolecki edole...@gmail.comwrote: Okay this thing may be the coolest thing I've seen in a while. However it's acting funny. If I do

Re: [Flashcoders] Intersection on circle based on angle

2009-03-17 Thread Mark Winterhalder
On Tue, Mar 17, 2009 at 2:17 PM, Eric E. Dolecki edole...@gmail.com wrote: I've done this before but can't find my file(s). I am currently googling but haven't found the answer yet (I'm sure it's out there, just need to rediscover it). I have a circle, registration at 0, 0. If I have an angle

Re: [Flashcoders] Intersection on circle based on angle

2009-03-17 Thread Mark Winterhalder
After seeing Jason's mail, I notice I should add that the angle is supposed to be in radians (i.e., degrees / 180 * Math.PI). However, he already provided a convenient set of functions, so you probably don't need that anymore... :) Mark On Tue, Mar 17, 2009 at 3:50 PM, Mark Winterhalder

RE: [Flashcoders] Intersection on circle based on angle

2009-03-17 Thread Merrill, Jason
var coord:Point = Point.polar( _radius, angle ); Yeah, did you see my post? :) Point.polar takes radians, not angle. They are not the same thing. I posted some methods for you which do the heavy lifting and conversion of angle to radians. Try it out and see if any of those methods work for

Re: [Flashcoders] Intersection on circle based on angle

2009-03-17 Thread Eric E. Dolecki
Thanks man, you just changed my world. On Tue, Mar 17, 2009 at 10:26 AM, Merrill, Jason jason.merr...@bankofamerica.com wrote: I have the angle (say 0 degrees). The length would then be pixels from the center (ie. radius)? Yes, radius is pixel distance from starting point (in your case,

RE: [Flashcoders] Intersection on circle based on angle

2009-03-17 Thread Steve Abaffy
: [Flashcoders] Intersection on circle based on angle Jason, Could you elaborate please? Point.polar( length, angle ); I have the angle (say 0 degrees). The length would then be pixels from the center (ie. radius)? On Tue, Mar 17, 2009 at 9:53 AM, Merrill, Jason jason.merr...@bankofamerica.com

Re: [Flashcoders] Intersection on circle based on angle

2009-03-17 Thread Piers Cowburn
Lots of cool stuff in the Rectangle class too, in case you didn't know :) Piers On 17 Mar 2009, at 15:00, Eric E. Dolecki wrote: Thanks man, you just changed my world. On Tue, Mar 17, 2009 at 10:26 AM, Merrill, Jason jason.merr...@bankofamerica.com wrote: I have the angle (say 0

Re: [Flashcoders] Intersection on circle based on angle

2009-03-17 Thread Eric E. Dolecki
Yup - .polar is working GREAT (and yes, using radians) now lets say I have a position somewhere and I want to see where an angle from it intersects a rectangle (assuming the point is within the rectangle)... is there a similar method to get that x, y? On Tue, Mar 17, 2009 at 11:36 AM, Piers