# 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)

*** ** * ** ***


```
public final class EasingFunction.CubicBezier extends EasingFunction
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.ink.brush.behavior.EasingFunction](https://developer.android.com/reference/androidx/ink/brush/behavior/EasingFunction) ||
|   | ↳ | [androidx.ink.brush.behavior.EasingFunction.CubicBezier](https://developer.android.com/reference/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/androidx/ink/brush/behavior/EasingFunction.CubicBezier#p1()` and `https://developer.android.com/reference/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/androidx/ink/brush/behavior/EasingFunction.CubicBezier#p1()`.x and `https://developer.android.com/reference/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/androidx/ink/brush/behavior/EasingFunction.CubicBezier#CubicBezier(androidx.ink.geometry.Vec,androidx.ink.geometry.Vec)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/Vec p1, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/Vec p2)` Creates a new `https://developer.android.com/reference/androidx/ink/brush/behavior/EasingFunction.CubicBezier` easing function. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/ink/brush/behavior/EasingFunction.CubicBezier#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/ImmutableVec` | `https://developer.android.com/reference/androidx/ink/brush/behavior/EasingFunction.CubicBezier#getP1()()` The first control point. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/ImmutableVec` | `https://developer.android.com/reference/androidx/ink/brush/behavior/EasingFunction.CubicBezier#getP2()()` The second control point. |
| `int` | `https://developer.android.com/reference/androidx/ink/brush/behavior/EasingFunction.CubicBezier#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/ink/brush/behavior/EasingFunction.CubicBezier#toString()()` |

### Inherited methods

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

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

## Public constructors

### CubicBezier

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

```
public CubicBezier(@NonNull Vec p1, @NonNull Vec p2)
```

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

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

## Public methods

### equals

```
public boolean equals(Object other)
```

### getP1

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

```
public final @NonNull ImmutableVec getP1()
```

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

### getP2

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

```
public final @NonNull ImmutableVec getP2()
```

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

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```