Arma 3 Scripting

Function in Math

BIS_fnc_roundDir

Also available as Markdown and JSON, or read the original wiki page.

Description

Round direction to nearest set rounding; used for determining cardinal direction.

Syntax

[rawDirection, rounding] call BIS_fnc_roundDir

Parameters:

Returns: Number - rounded direction, depending on input. Can be negative or over 360

Examples

Example 1

player setDir ([getDir player, 45] call BIS_fnc_roundDir);

Example 2

[204.2, 10] call BIS_fnc_roundDir; // will return 200

Example 3

[271, 180] call BIS_fnc_roundDir; // will return 360

Example 4

70 call BIS_fnc_roundDir; // will return 90

See also

setDir · getRelDir · round