# ArcAnimationSpec

Artifact: [androidx.compose.animation:animation-core](https://developer.android.com/jetpack/androidx/releases/compose-animation) [View Source](https://cs.android.com/search?q=file:androidx/compose/animation/core/AnimationSpec.kt+class:androidx.compose.animation.core.ArcAnimationSpec) Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.7.0) Common/All
- Cmn

  ```
  @ExperimentalAnimationSpecApi
  class ArcAnimationSpec<T : Any?> : DurationBasedAnimationSpec<T>
  ```

*** ** * ** ***

`https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DurationBasedAnimationSpec` that interpolates 2-dimensional values using arcs of quarter of an Ellipse.

To interpolate with `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/package-summary#keyframes(kotlin.Function1)` use `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpec.KeyframesSpecConfig#(androidx.compose.animation.core.KeyframesSpec.KeyframeEntity).using(androidx.compose.animation.core.ArcMode)` with an `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcMode`.

As such, it's recommended that `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcAnimationSpec` is only used for positional values such as: `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntOffset` or `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpOffset`.

The orientation of the arc is indicated by the given `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcAnimationSpec#(androidx.compose.animation.core.ArcMode,kotlin.Int,kotlin.Int,androidx.compose.animation.core.Easing)`.

Do note, that if the target value being animated only changes in one dimension, you'll only be able to get a linear curve.

Similarly, one-dimensional values will always only interpolate on a linear curve.

```kotlin
import androidx.compose.animation.core.ArcAnimationSpec
import androidx.compose.animation.core.ArcMode.Companion.ArcAbove
import androidx.compose.ui.geometry.Offset

// Will interpolate the Offset in arcs such that the curve of the quarter of an Ellipse is above
// the center.
ArcAnimationSpec<Offset>(mode = ArcAbove)
```

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcMode` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/package-summary#keyframes(kotlin.Function1)` |   |

## Summary

| ### Public constructors |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcAnimationSpec#ArcAnimationSpec(androidx.compose.animation.core.ArcMode,kotlin.Int,kotlin.Int,androidx.compose.animation.core.Easing)( mode: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcMode, durationMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, easing: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing )` | Cmn |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcAnimationSpec#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcAnimationSpec#hashCode()()` | Cmn |
| `open https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedDurationBasedAnimationSpec<V>` | `<V : https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector> https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcAnimationSpec#vectorize(androidx.compose.animation.core.TwoWayConverter)(converter: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TwoWayConverter<T, V>)` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec` with the given `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TwoWayConverter`. | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcAnimationSpec#delayMillis()` Time the animation waits before starting. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcAnimationSpec#durationMillis()` Duration of the animation. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcAnimationSpec#easing()` `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing` applied on the animation curve. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcMode` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcAnimationSpec#mode()` Orientation of the arc. | Cmn |

## Public constructors

### ArcAnimationSpec

Cmn Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.10.0)

```
<T : Any?> ArcAnimationSpec(
    mode: ArcMode = ArcBelow,
    durationMillis: Int = DefaultDurationMillis,
    delayMillis: Int = 0,
    easing: Easing = FastOutSlowInEasing
)
```

| Parameters |
|---|---|
| `mode: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcMode = ArcBelow` | Orientation of the arc. |
| `durationMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = DefaultDurationMillis` | Duration of the animation. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationConstants#DefaultDurationMillis()` by default. |
| `delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = 0` | Time the animation waits before starting. 0 by default. |
| `easing: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing = FastOutSlowInEasing` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing` applied on the animation curve. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/package-summary#FastOutSlowInEasing()` by default. |

## Public functions

### equals

Cmn

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

Cmn

```
open fun hashCode(): Int
```

### vectorize

Cmn

```
open fun <V : AnimationVector> vectorize(converter: TwoWayConverter<T, V>): VectorizedDurationBasedAnimationSpec<V>
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec` with the given `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TwoWayConverter`.

The underlying animation system operates on `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector`s. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec` will be converted to `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector` to animate. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec` describes how the converted `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector` should be animated. E.g. The animation could simply interpolate between the start and end values (i.e.`https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TweenSpec`), or apply spring physics to produce the motion (i.e. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec`), etc)

| Parameters |
|---|---|
| `converter: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TwoWayConverter<T, V>` | converts the type `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec` from and to `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector` type |

## Public properties

### delayMillis

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.7.0)

```
val delayMillis: Int
```

Time the animation waits before starting. 0 by default.

### durationMillis

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.7.0)

```
val durationMillis: Int
```

Duration of the animation. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationConstants#DefaultDurationMillis()` by default.

### easing

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.7.0)

```
val easing: Easing
```

`https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing` applied on the animation curve. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/package-summary#FastOutSlowInEasing()` by default.

### mode

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.7.0)

```
val mode: ArcMode
```

Orientation of the arc.