---
name: "BIS_fnc_clerp"
type: function
status: ok
groups: ["Interpolation"]
arma3_since: "1.78"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_clerp
revid: 349253
updated: 2023-11-08T14:51:03Z
---

# BIS_fnc_clerp

*Function · Interpolation · Arma 3 v1.78*

## Description

CLerp - Circular Lerp - is like lerp but handles the wraparound from 0 to 360
 This is useful when interpolating eulerAngles and the object crosses the 0/360 boundary
 The standard Lerp function causes the object to rotate in the wrong direction, clerp fixes that

## Syntax

```sqf
[currentValue, targetValue, alpha] call BIS_fnc_clerp
```

**Parameters:**

- `currentValue`: [Number](../topics/Number.md) - the current value
- `targetValue`: [Number](../topics/Number.md) - the target value
- `alpha`: [Number](../topics/Number.md) - the alpha

**Returns:** [Number](../topics/Number.md) - interpolated value

## Examples

### Example 1

```sqf
[90,170,0.1] call BIS_fnc_clerp; // Returns 98
```

## See also

[BIS_fnc_slerp](../functions/BIS_fnc_slerp.md) · [BIS_fnc_lerp](../functions/BIS_fnc_lerp.md) · [BIS_fnc_lerpVector](../functions/BIS_fnc_lerpVector.md) · [BIS_fnc_inverseLerp](../functions/BIS_fnc_inverseLerp.md)

<sub>Source: [BI Community Wiki — BIS fnc clerp](https://community.bistudio.com/wiki/BIS_fnc_clerp) (revision 349253).</sub>
