# CurveFit

Artifact: [androidx.constraintlayout:constraintlayout-core](https://developer.android.com/jetpack/androidx/releases/constraintlayout) [View Source](https://cs.android.com/search?q=file:androidx/constraintlayout/core/motion/utils/CurveFit.java+class:androidx.constraintlayout.core.motion.utils.CurveFit) Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

*** ** * ** ***

<br />

```
abstract class CurveFit
```

<br />

Known direct subclasses [ArcCurveFit](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/ArcCurveFit), [LinearCurveFit](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/LinearCurveFit), [MonotonicCurveFit](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/MonotonicCurveFit)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/ArcCurveFit` | This provides provides a curve fit system that stitches the x,y path together with quarter ellipses |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/LinearCurveFit` | This performs a simple linear interpolation in multiple dimensions |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/MonotonicCurveFit` | This performs a spline interpolation in multiple dimensions |

*** ** * ** ***

Base class for curve fitting / interpolation Curve fits must be capable of being differentiable and extend beyond the points (extrapolate)

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/CurveFit#CONSTANT() = 2` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/CurveFit#LINEAR() = 1` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/CurveFit#SPLINE() = 0` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/CurveFit#CurveFit()()` |

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/CurveFit!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/CurveFit#get(int,double[],double[][])(type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, time: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html>!, y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html>!>!)` |
| `java-static https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/CurveFit!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/CurveFit#getArc(int[],double[],double[][])( arcModes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!, time: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html>!, y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html>!>! )` |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/CurveFit#getPos(double,int)(t: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html, j: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/CurveFit#getPos(double,double[])(t: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html, v: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html>!)` |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/CurveFit#getPos(double,float[])(t: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html, v: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!)` |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/CurveFit#getSlope(double,int)(t: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html, j: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/CurveFit#getSlope(double,double[])(t: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html, v: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html>!)` |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/CurveFit#getTimePoints()()` |

## Constants

### CONSTANT

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

```
const val CONSTANT = 2: Int
```

### LINEAR

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

```
const val LINEAR = 1: Int
```

### SPLINE

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

```
const val SPLINE = 0: Int
```

## Public constructors

### CurveFit

Added in 1.1.2

```
CurveFit()
```

## Public functions

### get

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

```
java-static fun get(type: Int, time: DoubleArray<Double>!, y: Array<DoubleArray<Double>!>!): CurveFit!
```

### getArc

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

```
java-static fun getArc(
    arcModes: IntArray<Int>!,
    time: DoubleArray<Double>!,
    y: Array<DoubleArray<Double>!>!
): CurveFit!
```

### getPos

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

```
abstract fun getPos(t: Double, j: Int): Double
```

### getPos

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

```
abstract fun getPos(t: Double, v: DoubleArray<Double>!): Unit
```

### getPos

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

```
abstract fun getPos(t: Double, v: FloatArray<Float>!): Unit
```

### getSlope

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

```
abstract fun getSlope(t: Double, j: Int): Double
```

### getSlope

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

```
abstract fun getSlope(t: Double, v: DoubleArray<Double>!): Unit
```

### getTimePoints

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

```
abstract fun getTimePoints(): Array<Double>!
```