# CubicBezierEasing

# CubicBezierEasing

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/Easing.kt+class:androidx.compose.animation.core.CubicBezierEasing)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.0.0)
Common/All
  - Cmn  

  ```
  class CubicBezierEasing : Easing
  ```

*** ** * ** ***

A cubic polynomial easing.

The[CubicBezierEasing](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/CubicBezierEasing)class implements third-order Bézier curves.

This is equivalent to the Android`PathInterpolator`when a single cubic Bézier curve is specified.

Note:[CubicBezierEasing](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/CubicBezierEasing)instances are stateless and can be used concurrently from multiple threads.

Rather than creating a new instance, consider using one of the common cubic[Easing](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing)s:  

|                                                                    See also                                                                     |
|-------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [FastOutSlowInEasing](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/package-summary#FastOutSlowInEasing())     |   |
| [LinearOutSlowInEasing](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/package-summary#LinearOutSlowInEasing()) |   |
| [FastOutLinearInEasing](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/package-summary#FastOutLinearInEasing()) |   |

## Summary

|                                                                                                                                                                                                                                                                ### Public constructors                                                                                                                                                                                                                                                                 |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [CubicBezierEasing](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/CubicBezierEasing#CubicBezierEasing(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float))`(a: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, b: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, c: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, d: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` | Cmn |

|                                        ### Public functions                                         |
|-----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/CubicBezierEasing#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)`                                                                                                                                                                                                                         | Cmn |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                  | [hashCode](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/CubicBezierEasing#hashCode())`()`                                                                                                                                                                                                                                                                                                                    | Cmn |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)            | [toString](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/CubicBezierEasing#toString())`()`                                                                                                                                                                                                                                                                                                                    | Cmn |
| `open `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)              | [transform](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/CubicBezierEasing#transform(kotlin.Float))`(fraction: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Transforms the specified[fraction](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/CubicBezierEasing#transform(kotlin.Float))in the range 0..1 by this cubic Bézier curve. | Cmn |

## Public constructors

### CubicBezierEasing

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

```
CubicBezierEasing(a: Float, b: Float, c: Float, d: Float)
```  

|                                      Parameters                                      |
|--------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `a: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The x coordinate of the first control point. The line through the point (0, 0) and the first control point is tangent to the easing at the point (0, 0).   |
| `b: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The y coordinate of the first control point. The line through the point (0, 0) and the first control point is tangent to the easing at the point (0, 0).   |
| `c: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The x coordinate of the second control point. The line through the point (1, 1) and the second control point is tangent to the easing at the point (1, 1). |
| `d: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The y coordinate of the second control point. The line through the point (1, 1) and the second control point is tangent to the easing at the point (1, 1). |

## Public functions

### equals

Cmn  

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

### hashCode

Cmn  

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

### toString

Cmn  

```
open fun toString(): String
```  

### transform

Cmn  

```
open fun transform(fraction: Float): Float
```

Transforms the specified[fraction](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/CubicBezierEasing#transform(kotlin.Float))in the range 0..1 by this cubic Bézier curve. To solve the curve,[fraction](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/CubicBezierEasing#transform(kotlin.Float))is used as the x coordinate along the curve, and the corresponding y coordinate on the curve is returned. If no solution exists, this method throws an[IllegalArgumentException](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html).  

|                                                             Throws                                                             |
|--------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
| [kotlin.IllegalArgumentException](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html) | If the cubic Bézier curve cannot be solved |