# EasingFunction.CubicBezier

Artifact: [androidx.ink:ink-brush](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/brush/behavior/EasingFunction.kt+class:androidx.ink.brush.behavior.EasingFunction.CubicBezier) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

*** ** * ** ***

Common/All
- Cmn

  ```
  class EasingFunction.CubicBezier : EasingFunction
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.ink.brush.behavior.EasingFunction](https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction) ||
|   | ↳ | [androidx.ink.brush.behavior.EasingFunction.CubicBezier](https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction.CubicBezier) |

*** ** * ** ***

Parameters for a custom cubic Bezier easing function.

A cubic Bezier is generally defined by four points, from P0 to P3. In the case of the easing function, P0 is defined to be the point (0, 0), and P3 is defined to be the point (1, 1). The x-values of `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction.CubicBezier#p1()` and `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction.CubicBezier#p2()` are required to be in the range 0, 1. This guarantees that the resulting curve is a function with respect to x and follows the [CSS specification](https://www.w3.org/TR/css-easing-1/#cubic-bezier-easing-functions)

Valid parameters must have all finite values, and `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction.CubicBezier#p1()`.x and `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction.CubicBezier#p2()`.x must be in the interval 0, 1.

Input x values that are outside the interval 0, 1 will be clamped, but output values will not. This is somewhat different from the w3c defined cubic Bezier that allows extrapolated values outside x in 0, 1 by following end-point tangents.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction.CubicBezier#CubicBezier(androidx.ink.geometry.Vec,androidx.ink.geometry.Vec)(p1: https://developer.android.com/reference/kotlin/androidx/ink/geometry/Vec, p2: https://developer.android.com/reference/kotlin/androidx/ink/geometry/Vec)` Creates a new `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction.CubicBezier` easing function. | Cmn |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction.CubicBezier#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/ink/brush/behavior/EasingFunction.CubicBezier#hashCode()()` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction.CubicBezier#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableVec` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction.CubicBezier#p1()` The first control point. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableVec` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction.CubicBezier#p2()` The second control point. | Cmn |

### Inherited functions

From [androidx.ink.brush.behavior.EasingFunction](https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction) `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction#calculateMinimumRequiredVersion()()`

Returns the minimum required `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` for this `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction`.
Cmn

## Public constructors

### CubicBezier

Cmn Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
CubicBezier(p1: Vec, p2: Vec)
```

Creates a new `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/EasingFunction.CubicBezier` easing function.

| Parameters |
|---|---|
| `p1: https://developer.android.com/reference/kotlin/androidx/ink/geometry/Vec` | The first control point. Its x-coordinate must be in the range 0, 1. |
| `p2: https://developer.android.com/reference/kotlin/androidx/ink/geometry/Vec` | The second control point. Its x-coordinate must be in the range 0, 1. |

## Public functions

### equals

Cmn

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

### hashCode

Cmn

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

### toString

Cmn

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

## Public properties

### p1

Cmn Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
val p1: ImmutableVec
```

The first control point. Its x-coordinate must be in the range 0, 1.

### p2

Cmn Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
val p2: ImmutableVec
```

The second control point. Its x-coordinate must be in the range 0, 1.