|
ATanFull | |
Degrees# = ATanFull(Y, X) | |
Parameters: Y = The value representing the y-coordinate of a point. X = The value representing the x-coordinate of a point. |
|
Returns: Degrees# = Angle in degrees range between (-180 to 180) |
|
ATanFull calculates the arc tangent of the two variables Y and X. It is similar to calculating the arc tangent of X / Y, except that the signs of both arguments are used to determine the quadrant of the result. ATanFull can be used to aim one sprite at another. For example, if Sprite #1 is at the point(X1, Y1), and Sprite #2 is at point (X2, Y2), ATanFull(Y1-Y2. X1-X2) will return an angle (in degrees) that can be used to rotate Sprite #2 so that it aims at Sprite #1. FACTS: * In some programming languages ATanFull is called ATan2 * Notice the order of the parameters Y and X. * Also See GetAngle2D and WrapAngle if want the angle to be within 0 to 360 Mini Tutorial:
|
Related Info: | AngleDifference | Atan | CurveAngle | GetAngle2D | GetDistance2D | Tan | TurnDirection | WrapAngle : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |