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.
Printable View
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.
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.
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.
Angles are measured in two ways, degrees and radians. One returns the answer in degrees, the other in radians.