# math.lerpAngle

Function · category: Math

Source: https://github.com/playcanvas/engine/blob/970d89f6d3bc6667f4e1f88153abd6e7e82ed52c/src/core/math/math.js#L175

```ts
lerpAngle(a: number, b: number, alpha: number): number
```

Calculates the linear interpolation of two angles ensuring that interpolation is correctly
performed across the 360 to 0 degree boundary. Angles are supplied in degrees.

**Parameters**

- `a` (`number`): Angle (in degrees) to linearly interpolate from.
- `b` (`number`): Angle (in degrees) to linearly interpolate to.
- `alpha` (`number`): The value controlling the result of interpolation. When alpha is 0,
  a is returned. When alpha is 1, b is returned. Between 0 and 1, a linear interpolation
  between a and b is returned. alpha is clamped between 0 and 1.

**Returns** `number`: The linear interpolation of two angles.

**Example**

```ts
math.lerpAngle(350, 10, 0.5); // returns 0 (shortest path crosses 360/0 boundary)
math.lerpAngle(0, 90, 0.5);   // returns 45
```
