# PathInterpolatorCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/view/animation/PathInterpolatorCompat.java+class:androidx.core.view.animation.PathInterpolatorCompat) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***


```
public final class PathInterpolatorCompat
```

<br />

*** ** * ** ***

Helper for creating path-based `https://developer.android.com/reference/android/view/animation/Interpolator.html` instances. The platform implementation will be used.

## Summary

| ### Public methods |
|---|---|
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/animation/Interpolator.html` | `https://developer.android.com/reference/androidx/core/view/animation/PathInterpolatorCompat#create(android.graphics.Path)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/Path.html path)` Create an `https://developer.android.com/reference/android/view/animation/Interpolator.html` for an arbitrary `https://developer.android.com/reference/android/graphics/Path.html`. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/animation/Interpolator.html` | `https://developer.android.com/reference/androidx/core/view/animation/PathInterpolatorCompat#create(float,float)(float controlX, float controlY)` Create an `https://developer.android.com/reference/android/view/animation/Interpolator.html` for a quadratic Bezier curve. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/animation/Interpolator.html` | `https://developer.android.com/reference/androidx/core/view/animation/PathInterpolatorCompat#create(float,float,float,float)( float controlX1, float controlY1, float controlX2, float controlY2 )` Create an `https://developer.android.com/reference/android/view/animation/Interpolator.html` for a cubic Bezier curve. |

## Public methods

### create

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

```
public static @NonNull Interpolator create(@NonNull Path path)
```

Create an `https://developer.android.com/reference/android/view/animation/Interpolator.html` for an arbitrary `https://developer.android.com/reference/android/graphics/Path.html`. The `https://developer.android.com/reference/android/graphics/Path.html` must begin at `(0, 0)` and end at `(1, 1)`. The x-coordinate along the `https://developer.android.com/reference/android/graphics/Path.html` is the input value and the output is the y coordinate of the line at that point. This means that the Path must conform to a function `y = f(x)`.
The `https://developer.android.com/reference/android/graphics/Path.html` must not have gaps in the x direction and must not loop back on itself such that there can be two points sharing the same x coordinate.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/Path.html path` | the `https://developer.android.com/reference/android/graphics/Path.html` to use to make the line representing the `https://developer.android.com/reference/android/view/animation/Interpolator.html` |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/animation/Interpolator.html` | the `https://developer.android.com/reference/android/view/animation/Interpolator.html` representing the `https://developer.android.com/reference/android/graphics/Path.html` |

### create

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

```
public static @NonNull Interpolator create(float controlX, float controlY)
```

Create an `https://developer.android.com/reference/android/view/animation/Interpolator.html` for a quadratic Bezier curve. The end points `(0, 0)` and `(1, 1)` are assumed.

| Parameters |
|---|---|
| `float controlX` | the x coordinate of the quadratic Bezier control point |
| `float controlY` | the y coordinate of the quadratic Bezier control point |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/animation/Interpolator.html` | the `https://developer.android.com/reference/android/view/animation/Interpolator.html` representing the quadratic Bezier curve |

### create

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

```
public static @NonNull Interpolator create(
    float controlX1,
    float controlY1,
    float controlX2,
    float controlY2
)
```

Create an `https://developer.android.com/reference/android/view/animation/Interpolator.html` for a cubic Bezier curve. The end points `(0, 0)` and `(1, 1)` are assumed.

| Parameters |
|---|---|
| `float controlX1` | the x coordinate of the first control point of the cubic Bezier |
| `float controlY1` | the y coordinate of the first control point of the cubic Bezier |
| `float controlX2` | the x coordinate of the second control point of the cubic Bezier |
| `float controlY2` | the y coordinate of the second control point of the cubic Bezier |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/animation/Interpolator.html` | the `https://developer.android.com/reference/android/view/animation/Interpolator.html` representing the cubic Bezier curve |