# interpolateBetween (Shared)

> Interpolates between two sets of three numbers along an easing curve.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Data and utilities
- **URL**: https://wiki.mymp.gg/en/interpolateBetween

## Syntax

```lua
float, float, float interpolateBetween(float x1, y1, z1, float x2, y2, z2, float progress, string easingType [, float easingPeriod = 0.3, float easingAmplitude = 1, float easingOvershoot = 1.70158])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `x1, y1, z1` | `float` | The starting values. A `vec3` also works. |
| `x2, y2, z2` | `float` | The target values. A `vec3` also works. |
| `progress` | `float` | The progress, from 0 to 1. |
| `easingType` | `string` | The easing curve, such as `"Linear"`, `"InOutQuad"`, `"OutBounce"` or `"SineCurve"`. |
| `easingPeriod` | `float` | The period of the elastic curves. *(default: `0.3`)* |
| `easingAmplitude` | `float` | The amplitude of the elastic and bounce curves. *(default: `1`)* |
| `easingOvershoot` | `float` | How far the `Back` curves overshoot the target. *(default: `1.70158`)* |

## Returns

The three interpolated numbers. With progress at 1 or more, they are exactly the target ones when the curve ends there.

## Example

```lua
local start = getTickCount()
addEventHandler("onClientRender", root, function()
    local progress = math.min((getTickCount() - start) / 2000, 1)
    local x, y = interpolateBetween(0, 0, 0, 400, 300, 0, progress, "InOutQuad")
    dxDrawText("Hello", x, y)
end)
```

## See also

- [getEasingValue (Shared)](https://wiki.mymp.gg/en/getEasingValue.md): Works out an easing curve's value at a point of the progress.
- [moveObject (Shared)](https://wiki.mymp.gg/en/moveObject.md): Moves an object smoothly to a position, turning it along the way.
