note Help Needed
This wiki is the result of an ongoing community effort — thank you all for helping!
If you want to provide changes to this page then please click here.
atan
warning
This function starts with a lowercase letter.
warning
Notice that the y-value is the first parameter and the x-value is the second parameter. This is because the mathematical notation is y/x (i.e. y divided by x) and the convention is to write the operands in the order of the operation that is performed on them.
Description
Get the multi-valued inversed value of a tangent in degrees. In trigonometrics, arc tangent is the inverse operation of tangent. To compute the value, the function takes into account the sign of both arguments in order to determine the quadrant.
Name | Description |
---|---|
Float:y | value representing the proportion of the y-coordinate. |
Float:x | value representing the proportion of the x-coordinate. |
Returns
The angle in degrees, in the interval [-180.0,+180.0].
Examples
//The arc tangent for (x=-10.000000, y=10.000000) is 135.000000 degrees.
public OnGameModeInit()
{
new Float:x, Float:y, Float:result;
x = -10.0;
y = 10.0;
result = atan2(y, x);
printf("The arc tangent for (x=%f, y=%f) is %f degrees.", x, y, result);
return 1;
}