# HyperSpline

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/HyperSpline.java+class:androidx.constraintlayout.core.motion.utils.HyperSpline) Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

*** ** * ** ***


```
public class HyperSpline
```

<br />

*** ** * ** ***

Provides spline interpolation code. Currently not used but it is anticipated that we will be using it in the KeyMotion

## Summary

| ### Nested types |
|---|
| `public class https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/HyperSpline.Cubic` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/HyperSpline#HyperSpline()()` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/HyperSpline#HyperSpline(double[][])(double[][] points)` Spline in N dimensions |

| ### Public methods |
|---|---|
| `double` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/HyperSpline#approxLength(androidx.constraintlayout.core.motion.utils.HyperSpline.Cubic[])(HyperSpline.Cubic[] curve)` |
| `double` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/HyperSpline#getPos(double,int)(double p, int splineNumber)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/HyperSpline#getPos(double,double[])(double p, double[] x)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/HyperSpline#getPos(double,float[])(double p, float[] x)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/HyperSpline#getVelocity(double,double[])(double p, double[] v)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/HyperSpline#setup(double[][])(double[][] points)` |

## Public constructors

### HyperSpline

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

```
public HyperSpline()
```

### HyperSpline

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

```
public HyperSpline(double[][] points)
```

Spline in N dimensions

| Parameters |
|---|---|
| `double[][] points` | \[mPoints\]\[dimensionality\] |

## Public methods

### approxLength

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

```
public double approxLength(HyperSpline.Cubic[] curve)
```

### getPos

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

```
public double getPos(double p, int splineNumber)
```

### getPos

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

```
public void getPos(double p, double[] x)
```

### getPos

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

```
public void getPos(double p, float[] x)
```

### getVelocity

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

```
public void getVelocity(double p, double[] v)
```

### setup

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

```
public void setup(double[][] points)
```