{"name":"BIS_fnc_clerp","title":"BIS fnc clerp","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_clerp","revid":349253,"updated":"2023-11-08T14:51:03Z","groups":["Interpolation"],"status":"ok","games":{"arma3":"1.78"},"since":"arma3 1.78","arma3_since":"1.78","description":"CLerp - Circular Lerp - is like lerp but handles the wraparound from 0 to 360\n\n```\nThis is useful when interpolating eulerAngles and the object crosses the 0/360 boundary\nThe standard Lerp function causes the object to rotate in the wrong direction, clerp fixes that\n```","syntaxes":[{"syntax":"[currentValue, targetValue, alpha] call BIS_fnc_clerp","params":[{"name":"currentValue","type":"Number","description":"the current value","type_expr":"Number"},{"name":"targetValue","type":"Number","description":"the target value","type_expr":"Number"},{"name":"alpha","type":"Number","description":"the alpha","type_expr":"Number"}],"returns":{"type":"Number","type_expr":"Number","description":"interpolated value"}}],"examples":[{"code":["[90,170,0.1] call BIS_fnc_clerp; // Returns 98"]}],"see_also":["BIS_fnc_slerp","BIS_fnc_lerp","BIS_fnc_lerpVector","BIS_fnc_inverseLerp"]}