---
title: "FloatDecayAnimationSpec"
description: "This animation interface is intended to be stateless, just like Animation<T>. But unlike
Animation<T>, DecayAnimation does not have an end value defined. The end value is a result of the
animation rather than an input."
type: "interface"
---

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


<a id='references'></a>

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



```kotlin
public interface FloatDecayAnimationSpec
```


This animation interface is intended to be stateless, just like Animation<T>. But unlike
Animation<T>, DecayAnimation does not have an end value defined. The end value is a result of the
animation rather than an input.


## Functions

```kotlin
public fun getValueFromNanos(
        playTimeNanos: Long,
        initialValue: Float,
        initialVelocity: Float,
    ): Float
```


Returns the value of the animation at the given time.

#### Parameters

| | |
| --- | --- |
| playTimeNanos | The time elapsed in milliseconds since the start of the animation |
| initialValue | The start value of the animation |
| initialVelocity | The start velocity of the animation |



```kotlin
public fun getDurationNanos(initialValue: Float, initialVelocity: Float): Long
```


Returns the duration of the decay animation, in nanoseconds.

#### Parameters

| | |
| --- | --- |
| initialValue | start value of the animation |
| initialVelocity | start velocity of the animation |



```kotlin
public fun getVelocityFromNanos(
        playTimeNanos: Long,
        initialValue: Float,
        initialVelocity: Float,
    ): Float
```


Returns the velocity of the animation at the given time.

#### Parameters

| | |
| --- | --- |
| playTimeNanos | The time elapsed in milliseconds since the start of the animation |
| initialValue | The start value of the animation |
| initialVelocity | The start velocity of the animation |



```kotlin
public fun getTargetValue(initialValue: Float, initialVelocity: Float): Float
```


Returns the target value of the animation based on the starting condition of the animation (
i.e. start value and start velocity).

#### Parameters

| | |
| --- | --- |
| initialValue | The start value of the animation |
| initialVelocity | The start velocity of the animation |




