# MutableCubic

Artifact: [androidx.graphics:graphics-shapes](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/shapes/Cubic.kt+class:androidx.graphics.shapes.MutableCubic) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

*** ** * ** ***


```
public final class MutableCubic extends Cubic
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.graphics.shapes.Cubic](https://developer.android.com/reference/androidx/graphics/shapes/Cubic) ||
|   | ↳ | [androidx.graphics.shapes.MutableCubic](https://developer.android.com/reference/androidx/graphics/shapes/MutableCubic) |

*** ** * ** ***

This is a Mutable version of `https://developer.android.com/reference/androidx/graphics/shapes/Cubic`, used mostly for performance critical paths so we can avoid creating new `https://developer.android.com/reference/androidx/graphics/shapes/Cubic`s

This is used in Morph.forEachCubic, reusing a `https://developer.android.com/reference/androidx/graphics/shapes/MutableCubic` instance to avoid creating new `https://developer.android.com/reference/androidx/graphics/shapes/Cubic`s.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/graphics/shapes/MutableCubic#MutableCubic()()` |

| ### Public methods |
|---|---|
| `final void` | `https://developer.android.com/reference/androidx/graphics/shapes/MutableCubic#interpolate(androidx.graphics.shapes.Cubic,androidx.graphics.shapes.Cubic,kotlin.Float)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Cubic c1, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Cubic c2, float progress)` |
| `final void` | `https://developer.android.com/reference/androidx/graphics/shapes/MutableCubic#transform(androidx.graphics.shapes.PointTransformer)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/PointTransformer f)` |

| ### Inherited methods |
|---|
| From [androidx.graphics.shapes.Cubic](https://developer.android.com/reference/androidx/graphics/shapes/Cubic) |---|---| | `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Cubic` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#div(kotlin.Float)(float x)` Operator overload to enable dividing Cubics by a scalar value x, like "c0 / x" | | `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Cubic` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#div(kotlin.Int)(int x)` Operator overload to enable dividing Cubics by a scalar value x, like "c0 / x" | | `boolean` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` | | `final float` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#getAnchor0X()()` The first anchor point x coordinate | | `final float` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#getAnchor0Y()()` The first anchor point y coordinate | | `final float` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#getAnchor1X()()` The second anchor point x coordinate | | `final float` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#getAnchor1Y()()` The second anchor point y coordinate | | `final float` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#getControl0X()()` The first control point x coordinate | | `final float` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#getControl0Y()()` The first control point y coordinate | | `final float` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#getControl1X()()` The second control point x coordinate | | `final float` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#getControl1Y()()` The second control point y coordinate | | `int` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#hashCode()()` | | `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Cubic` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#plus(androidx.graphics.shapes.Cubic)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Cubic o)` Operator overload to enable adding Cubic objects together, like "c0 + c1" | | `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Cubic` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#reverse()()` Utility function to reverse the control/anchor points for this curve. | | `final @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Cubic, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Cubic>` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#split(kotlin.Float)(float t)` Returns two Cubics, created by splitting this curve at the given distance of `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#split(kotlin.Float)` between the original starting and ending anchor points. | | `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Cubic` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#times(kotlin.Float)(float x)` Operator overload to enable multiplying Cubics by a scalar value x, like "c0 \* x" | | `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Cubic` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#times(kotlin.Int)(int x)` Operator overload to enable multiplying Cubics by an Int scalar value x, like "c0 \* x" | | `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#toString()()` | | `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/Cubic` | `https://developer.android.com/reference/androidx/graphics/shapes/Cubic#transformed(androidx.graphics.shapes.PointTransformer)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/shapes/PointTransformer f)` Transforms the points in this `https://developer.android.com/reference/androidx/graphics/shapes/Cubic` with the given `https://developer.android.com/reference/androidx/graphics/shapes/PointTransformer` and returns a new `https://developer.android.com/reference/androidx/graphics/shapes/Cubic` | |

## Public constructors

### MutableCubic

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

```
public MutableCubic()
```

## Public methods

### interpolate

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

```
public final void interpolate(@NonNull Cubic c1, @NonNull Cubic c2, float progress)
```

### transform

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

```
public final void transform(@NonNull PointTransformer f)
```