# math.smoothstep

Function · category: Math

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

```ts
smoothstep(min: number, max: number, x: number): number
```

The function interpolates smoothly between two input values based on a third one that should
be between the first two. The returned value is clamped between 0 and 1.

The slope (i.e. derivative) of the smoothstep function starts at 0 and ends at 0. This makes
it easy to create a sequence of transitions using smoothstep to interpolate each segment
rather than using a more sophisticated or expensive interpolation technique.

See https://en.wikipedia.org/wiki/Smoothstep for more details.

**Parameters**

- `min` (`number`): The lower bound of the interpolation range.
- `max` (`number`): The upper bound of the interpolation range.
- `x` (`number`): The value to interpolate.

**Returns** `number`: The smoothly interpolated value clamped between zero and one.

**Example**

```ts
math.smoothstep(0, 10, 5); // returns 0.5
```
