Floattan

From SA-MP Wiki

Jump to: navigation, search

floattan

Image:Farm-Fresh text lowercase.png Note: This function name starts with a lowercase letter.


Description:

Get the tangent from a given angle. The input angle may be in radians, degrees or grades.


Parameters:
(Float:value, anglemode:mode=radian)
Float:valueThe angle from which to get the tangent.
anglemodeThe angle mode to use, depending on the value entered.


Return Values:

The tangent from the value entered.


Image:32px-Circle-style-warning.png

Important
Note

GTA/SA-MP use degrees for angles in most circumstances, for example GetPlayerFacingAngle. Therefore, it is most likely you'll want to use the 'degrees' angle mode, not radians.

Also note that angles in GTA are counterclockwise; 270° is East and 90° is West. South is still 180° and North still 0°/360°.


Example Usage:

public OnGameModeInit()
{
    printf("The tangent from 30° is %f", floattan(30.0, degrees));
    // Output: 1
    return 1;
}

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

  • floatsin: Get the sine from a specific angle.
  • floatcos: Get the cosine from a specific angle.
Personal tools
Navigation
Toolbox