# PathInterpolatorCompat

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/view/animation/PathInterpolatorCompat "View this page in Java")

<br />

```
class PathInterpolatorCompat
```

<br />

*** ** * ** ***

Helper for creating path-based[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html)instances. On API 21 or newer, the platform implementation will be used and on older platforms a compatible alternative implementation will be used.

## Summary

|                                              ### Public functions                                              |
|----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html) | [create](https://developer.android.com/reference/kotlin/androidx/core/view/animation/PathInterpolatorCompat#create(android.graphics.Path))`(path: `[Path](https://developer.android.com/reference/android/graphics/Path.html)`)` Create an[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html)for an arbitrary[Path](https://developer.android.com/reference/android/graphics/Path.html).                                                                                                                                                                                                                                                   |
| `java-static `[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html) | [create](https://developer.android.com/reference/kotlin/androidx/core/view/animation/PathInterpolatorCompat#create(float,float))`(controlX: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, controlY: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Create an[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html)for a quadratic Bezier curve.                                                                                                                                                                                                                     |
| `java-static `[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html) | [create](https://developer.android.com/reference/kotlin/androidx/core/view/animation/PathInterpolatorCompat#create(float,float,float,float))`(` ` controlX1: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` controlY1: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` controlX2: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` controlY2: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) `)` Create an[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html)for a cubic Bezier curve. |

## Public functions

### create

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

```
java-static fun create(path: Path): Interpolator
```

Create an[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html)for an arbitrary[Path](https://developer.android.com/reference/android/graphics/Path.html). The[Path](https://developer.android.com/reference/android/graphics/Path.html)must begin at`(0, 0)`and end at`(1, 1)`. The x-coordinate along the[Path](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[Path](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                                     |
|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `path: `[Path](https://developer.android.com/reference/android/graphics/Path.html) | the[Path](https://developer.android.com/reference/android/graphics/Path.html)to use to make the line representing the[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html) |

|                                             Returns                                              |
|--------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html) | the[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html)representing the[Path](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)  

```
java-static fun create(controlX: Float, controlY: Float): Interpolator
```

Create an[Interpolator](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                                          |
|---------------------------------------------------------------------------------------------|--------------------------------------------------------|
| `controlX: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | the x coordinate of the quadratic Bezier control point |
| `controlY: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | the y coordinate of the quadratic Bezier control point |

|                                             Returns                                              |
|--------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| [Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html) | the[Interpolator](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)  

```
java-static fun create(
    controlX1: Float,
    controlY1: Float,
    controlX2: Float,
    controlY2: Float
): Interpolator
```

Create an[Interpolator](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                                          |
|----------------------------------------------------------------------------------------------|------------------------------------------------------------------|
| `controlX1: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | the x coordinate of the first control point of the cubic Bezier  |
| `controlY1: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | the y coordinate of the first control point of the cubic Bezier  |
| `controlX2: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | the x coordinate of the second control point of the cubic Bezier |
| `controlY2: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | the y coordinate of the second control point of the cubic Bezier |

|                                             Returns                                              |
|--------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
| [Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html) | the[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html)representing the cubic Bezier curve |