dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Math.atan && Math.atan2

Hybrid View

  1. #1
    Senior Member
    Join Date
    Sep 2000
    Location
    POA, Brazil
    Posts
    323

    Math.atan && Math.atan2

    Can someone please expplain to me what does Math.atan2 and Math.atan returns? I made a file to try to understand, but I cant figure out what they do!!!
    I saw a lot o fo files wich use those actions, but still couldnt understand.
    Attached Files Attached Files

  2. #2
    V For Victory! R1TAL1N's Avatar
    Join Date
    Jun 2005
    Location
    Chillin in Dub V...
    Posts
    230
    in trigonometry, tangent(tan) is the measure of the angle adjacent to the angle u want to find, over the angle opposite the angle u want to find. You use the Math.atan and atan2 to find this angle. you can use this to detect the mouse angle as well as other things i guess.

  3. #3
    #
    Join Date
    Apr 2002
    Location
    berlin - germany
    Posts
    107
    Math.atan returns an angle by a given Number (dy/dx).
    Math.atan2 provides 2 parameters as dy, dx - where dx can be zero, which is not allowed to divide by in mathematic context.

  4. #4
    Junior Member
    Join Date
    Oct 2005
    Posts
    1
    Quote Originally Posted by gabi_poa View Post
    Can someone please expplain to me what does Math.atan2 and Math.atan returns? I made a file to try to understand, but I cant figure out what they do!!!
    I saw a lot o fo files wich use those actions, but still couldnt understand.
    Math.atan2 returns the angle in radians of the resulting vector.

    var radians:Number = Math.atan2(dy,dx);
    var degrees:Number = radians * 180 / Math.PI;

  5. #5
    Member
    Join Date
    Feb 2010
    Posts
    59
    Angles are measured in two ways, degrees and radians. One returns the answer in degrees, the other in radians.

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