---
title: "lerp"
description: "Linearly interpolate between two [IntOffset]s.

The [fraction] argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning [start] (or something equivalent to [start]), 1.0
meaning that the interpolation has finished, returning [stop] (or something equivalent to
[stop]), and values in between meaning that the interpolation is at the relevant point on the
timeline between [start] and [stop]. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun lerp(start: IntOffset, stop: IntOffset, fraction: Float): IntOffset
```


Linearly interpolate between two `IntOffset`s.

The `fraction` argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning `start` (or something equivalent to `start`), 1.0
meaning that the interpolation has finished, returning `stop` (or something equivalent to
`stop`), and values in between meaning that the interpolation is at the relevant point on the
timeline between `start` and `stop`. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun lerp(start: TextUnit, stop: TextUnit, fraction: Float): TextUnit
```


Linearly interpolate between two `TextUnit`s.

The `fraction` argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning `start` (or something equivalent to `start`), 1.0
meaning that the interpolation has finished, returning `stop` (or something equivalent to
`stop`), and values in between meaning that the interpolation is at the relevant point on the
timeline between `start` and `stop`. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun lerp(start: Dp, stop: Dp, fraction: Float): Dp
```


Linearly interpolate between two `Dp`s.

The `fraction` argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning `start` (or something equivalent to `start`), 1.0
meaning that the interpolation has finished, returning `stop` (or something equivalent to
`stop`), and values in between meaning that the interpolation is at the relevant point on the
timeline between `start` and `stop`. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun lerp(start: DpOffset, stop: DpOffset, fraction: Float): DpOffset
```


Linearly interpolate between two `DpOffset`s.

The `fraction` argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning `start` (or something equivalent to `start`), 1.0
meaning that the interpolation has finished, returning `stop` (or something equivalent to
`stop`), and values in between meaning that the interpolation is at the relevant point on the
timeline between `start` and `stop`. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun lerp(start: DpSize, stop: DpSize, fraction: Float): DpSize
```


Linearly interpolate between two `DpSize`s.

The `fraction` argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning `start`, 1.0 meaning that the interpolation has
finished, returning `stop`, and values in between meaning that the interpolation is at the
relevant point on the timeline between `start` and `stop`. The interpolation can be extrapolated
beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun lerp(start: IntRect, stop: IntRect, fraction: Float): IntRect
```


Linearly interpolate between two rectangles.

The `fraction` argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning `start` (or something equivalent to `start`), 1.0
meaning that the interpolation has finished, returning `stop` (or something equivalent to
`stop`), and values in between meaning that the interpolation is at the relevant point on the
timeline between `start` and `stop`. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid (and can easily be generated by curves).

Values for `fraction` are usually obtained from an `Animation<Float>`, such as an
`AnimationController`.



