The scripting API provides various basic mathematics functions and constants to compute common mathematical operations and transformations.

### Abs

#### Abs

Description: Return the absolute value of a given number.

```float Abs(float fNumber)
int Abs(int fNumber)```

[in] fNumber: A number.
[return] Absolute value of fNumber.

Example:

```float _Value = Abs(-5.0f);
Print("absolute value of -5.0 is " + String(_Value));```

### Cos

#### Cos

Description: Returns the cosine of an angle of x radians.

`float Cos(float fNumber)`

[in] fNumber: Value representing an angle expressed in radians. One radian is equivalent to 180/PI degrees.

Example:

```float _Value = Cos(1.5f);
Print("cosine of 1.5 is " + String(_Value));```

Note: You can convert degrees to radians and vice version by using the Deg2Rad and Rad2Deg functions.

### Sin

#### Sin

Description: Returns the sine of an angle of x radians.

`float Sin(float fNumber)`

[in] fNumber: Value representing an angle expressed in radians. One radian is equivalent to 180/PI degrees.

Example:

```float _Value = Sin(1.5f);
Print("sine of 1.5 is " + String(_Value));```

Note: You can convert degrees to radians and vice version by using the Deg2Rad and Rad2Deg functions.

### Tan

#### Tan

• modding/scripting/api/math.txt