---
title: "calculateTargetValue"
description: "Calculates the target value of a decay animation based on the [initialValue] and
[initialVelocity], and the [typeConverter] that converts the given type [T] to [AnimationVector]."
type: "function"
---

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


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


```kotlin
public fun <T, V : AnimationVector> DecayAnimationSpec<T>.calculateTargetValue(
    typeConverter: TwoWayConverter<T, V>,
    initialValue: T,
    initialVelocity: T,
): T
```


Calculates the target value of a decay animation based on the `initialValue` and
`initialVelocity`, and the `typeConverter` that converts the given type `T` to `AnimationVector`.

#### Returns

| | |
| --- | --- |
|  | target value where the animation will come to a natural stop |




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


```kotlin
public fun DecayAnimationSpec<Float>.calculateTargetValue(
    initialValue: Float,
    initialVelocity: Float,
): Float
```


Calculates the target value of a Float decay animation based on the `initialValue` and
`initialVelocity`.

#### Returns

| | |
| --- | --- |
|  | target value where the animation will come to a natural stop |




