# MutableCubic

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/graphics/shapes/MutableCubic "View this page in Java")
Common/AllAndroid/JVM
  - Cmn  

  ```
  class MutableCubic : Cubic
```  

|---|---|-------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                                  |||
| ↳ | [androidx.graphics.shapes.Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic)                  ||
|   | ↳ | [androidx.graphics.shapes.MutableCubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/MutableCubic) |

*** ** * ** ***

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

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

## Summary

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

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [interpolate](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/MutableCubic#interpolate(androidx.graphics.shapes.Cubic,androidx.graphics.shapes.Cubic,kotlin.Float))`(c1: `[Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic)`, c2: `[Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic)`, progress: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` | Cmn |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [transform](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/MutableCubic#transform(androidx.graphics.shapes.PointTransformer))`(f: `[PointTransformer](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/PointTransformer)`)`                                                                                                                                                                                                            | Cmn |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.graphics.shapes.Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic) |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----| | `operator `[Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic)                                                                                                                                                                   | [div](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#div(kotlin.Float))`(x: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Operator overload to enable dividing Cubics by a scalar value x, like "c0 / x"                                                                                                                                                                                                                                                                                                                                                 | Cmn | | `operator `[Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic)                                                                                                                                                                   | [div](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#div(kotlin.Int))`(x: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Operator overload to enable dividing Cubics by a scalar value x, like "c0 / x"                                                                                                                                                                                                                                                                                                                                                       | Cmn | | `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                                                                                 | [equals](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)`                                                                                                                                                                                                                                                                                                                                                                                                                           | Cmn | | `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                                                                                                  | [hashCode](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#hashCode())`()`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Cmn | | `operator `[Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic)                                                                                                                                                                   | [plus](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#plus(androidx.graphics.shapes.Cubic))`(o: `[Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic)`)` Operator overload to enable adding Cubic objects together, like "c0 + c1"                                                                                                                                                                                                                                                                                                                           | Cmn | | [Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic)                                                                                                                                                                              | [reverse](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#reverse())`()` Utility function to reverse the control/anchor points for this curve.                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Cmn | | [Pair](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html)`<`[Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic)`, `[Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic)`>` | [split](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#split(kotlin.Float))`(t: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Returns two Cubics, created by splitting this curve at the given distance of[t](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#split(kotlin.Float))between the original starting and ending anchor points.                                                                                                                                                                                  | Cmn | | `operator `[Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic)                                                                                                                                                                   | [times](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#times(kotlin.Float))`(x: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Operator overload to enable multiplying Cubics by a scalar value x, like "c0 \* x"                                                                                                                                                                                                                                                                                                                                         | Cmn | | `operator `[Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic)                                                                                                                                                                   | [times](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#times(kotlin.Int))`(x: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Operator overload to enable multiplying Cubics by an Int scalar value x, like "c0 \* x"                                                                                                                                                                                                                                                                                                                                          | Cmn | | `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                                                                                                            | [toString](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#toString())`()`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Cmn | | [Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic)                                                                                                                                                                              | [transformed](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#transformed(androidx.graphics.shapes.PointTransformer))`(f: `[PointTransformer](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/PointTransformer)`)` Transforms the points in this[Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic)with the given[PointTransformer](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/PointTransformer)and returns a new[Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic) | Cmn | |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ### Inherited properties                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.graphics.shapes.Cubic](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic) |---------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|-----| | [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [anchor0X](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#anchor0X()) The first anchor point x coordinate     | Cmn | | [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [anchor0Y](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#anchor0Y()) The first anchor point y coordinate     | Cmn | | [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [anchor1X](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#anchor1X()) The second anchor point x coordinate    | Cmn | | [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [anchor1Y](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#anchor1Y()) The second anchor point y coordinate    | Cmn | | [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [control0X](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#control0X()) The first control point x coordinate  | Cmn | | [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [control0Y](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#control0Y()) The first control point y coordinate  | Cmn | | [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [control1X](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#control1X()) The second control point x coordinate | Cmn | | [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [control1Y](https://developer.android.com/reference/kotlin/androidx/graphics/shapes/Cubic#control1Y()) The second control point y coordinate | Cmn | |

## Public constructors

### MutableCubic

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

```
MutableCubic()
```

## Public functions

### interpolate

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

```
fun interpolate(c1: Cubic, c2: Cubic, progress: Float): Unit
```  

### transform

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

```
fun transform(f: PointTransformer): Unit
```