A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Points on a circle calculations (trig?)

  1. #1
    Member
    Join Date
    May 2007
    Posts
    46

    Points on a circle calculations (trig?)

    Hi all



    Have a look at the attachment.



    I have a circle menu and i want to do something with it, but i need to find the specific amount of movement on each axes.



    I do not know how to do this.



    If there is a point on a circle at 0 degrees and radius 200 px in width and there is another point 10 degrees away with the same radius, then how can i find out from these values how much the x and y position moved in that rotation?



    The drawing is more usful than me trying to explain it but thanks for giving it a go!



    Cheers,



    Clark
    Attached Images Attached Images

  2. #2
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    for both points:

    var p1x = Math.cos(pointAngle1) * radius
    var p1y = Math.sin(pointAngle1) * radius

    then just find the distance between those points

    var dx = p2x - p1x
    var dy = p2y - p1y
    lather yourself up with soap - soap arcade

  3. #3
    Member
    Join Date
    May 2007
    Posts
    46
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center