ACE3/addons/common/functions/fnc_interpolateFromArray.sqf
2015-09-19 22:27:23 +02:00

24 lines
449 B
Plaintext

/*
* Author: commy2
* Interpolates between two set points in a curve.
*
* Arguments:
* 0: List of numbers to interpolate from <ARRAY>
* 1: Value / index <NUMBER>
*
* Return Value:
* Interpolation result <NUMBER>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_array", "_value"];
private ["_min", "_max"];
_min = _array select floor _value;
_max = _array select ceil _value;
_min + (_max - _min) * (_value % 1) // return