Arma 3 Scripting

Function in Math

BIS_fnc_linearConversion

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

Warning

This function is deprecated. Use linearConversion instead.

Description

Linear conversion of a value from one set to another

Note

This function became obsolete with the introduction of linearConversion.

Syntax

[[minFrom, maxFrom], value, [minTo, maxTo]] call BIS_fnc_linearConversion

Parameters:

Returns: Number value adapted to [minTo, maxTo] range

Examples

Example 1

[[-50, 50], -50, [0, 1]] call BIS_fnc_linearConversion; // returns 0
[[-50, 50],   0, [0, 1]] call BIS_fnc_linearConversion; // returns 0.5
[[-50, 50], +50, [0, 1]] call BIS_fnc_linearConversion; // returns 1

See also

linearConversion