A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: angle between 2 points

  1. #1
    Member
    Join Date
    Jun 2009
    Posts
    44

    angle between 2 points

    i know this is simple but i just need the simplest code to find the angle between 2 points in flash 8.
    thankyou all.

  2. #2
    Member
    Join Date
    Oct 2006
    Location
    Belgium
    Posts
    36

    _rotation to point

    Hi hmvince,

    I've found a tutorial from Jim Bumgardner:


  3. #3
    Member
    Join Date
    Jun 2009
    Posts
    44
    thankyou WPRS
    i was also wondering in what direction is 0, 90, 180, and 270 in flash because i know that it is different to other programs but still unsure.
    thanks again
    Last edited by hmvince; 07-04-2009 at 06:50 PM.

  4. #4
    Member
    Join Date
    Oct 2006
    Location
    Belgium
    Posts
    36
    You are welcome

  5. #5
    Member
    Join Date
    Jun 2009
    Posts
    44
    did you know about the angles?

  6. #6
    Member
    Join Date
    Oct 2006
    Location
    Belgium
    Posts
    36
    PHP Code:
    function GetAngles (Direction1)
    {
        var 
    Direction2:Number Direction1 360;
        
        if ( 
    Direction2 <= 180 )
        {
            return ( 
    Direction2 );
        }
        else
        {
            return ( -( 
    Direction2 180 ) );
        }
    }

    trace (GetAngles (0));
    trace (GetAngles (90));
    trace (GetAngles (180));
    trace (GetAngles (270)); 

  7. #7
    Member
    Join Date
    Jun 2009
    Posts
    44
    this is not really what i meant.
    is 270 degrees to the right?
    is 90 degrees to the left?
    is 0 degrees to the up?
    is 180 degrees to the down?
    excuse my english

  8. #8
    Member
    Join Date
    Oct 2006
    Location
    Belgium
    Posts
    36

    Post

    http://geniusduck.tistory.com/tag/angle



    Code:
    var radians = degrees * Math.PI / 180
    var degrees = radians * 180 / Math.PI

  9. #9
    Member
    Join Date
    Jun 2009
    Posts
    44
    this isnt in flash though is it. because i heard once that the angles in flash are different, like rotated clockwise or something?

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