# MatrixKt

Added in 1.1.0

*** ** * ** ***


```
public final class MatrixKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Matrix.html` | `https://developer.android.com/reference/androidx/core/graphics/MatrixKt#rotationMatrix(kotlin.Float,kotlin.Float,kotlin.Float)(float degrees, float px, float py)` Creates a rotation matrix, defined by a rotation angle in degrees around the pivot point located at the coordinates (`https://developer.android.com/reference/androidx/core/graphics/package-summary#rotationMatrix(kotlin.Float,kotlin.Float,kotlin.Float)`, `https://developer.android.com/reference/androidx/core/graphics/package-summary#rotationMatrix(kotlin.Float,kotlin.Float,kotlin.Float)`). |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Matrix.html` | `https://developer.android.com/reference/androidx/core/graphics/MatrixKt#scaleMatrix(kotlin.Float,kotlin.Float)(float sx, float sy)` Creates a scale matrix with the scale factor `https://developer.android.com/reference/androidx/core/graphics/package-summary#scaleMatrix(kotlin.Float,kotlin.Float)` and `https://developer.android.com/reference/androidx/core/graphics/package-summary#scaleMatrix(kotlin.Float,kotlin.Float)` respectively on the `x` and `y` axis. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Matrix.html` | `https://developer.android.com/reference/androidx/core/graphics/MatrixKt#(android.graphics.Matrix).times(android.graphics.Matrix)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Matrix.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Matrix.html m)` Multiplies this `https://developer.android.com/reference/android/graphics/Matrix.html` by another matrix and returns the result as a new matrix. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Matrix.html` | `https://developer.android.com/reference/androidx/core/graphics/MatrixKt#translationMatrix(kotlin.Float,kotlin.Float)(float tx, float ty)` Creates a translation matrix with the translation amounts `https://developer.android.com/reference/androidx/core/graphics/package-summary#translationMatrix(kotlin.Float,kotlin.Float)` and `https://developer.android.com/reference/androidx/core/graphics/package-summary#translationMatrix(kotlin.Float,kotlin.Float)` respectively on the `x` and `y` axis. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull float[]` | `https://developer.android.com/reference/androidx/core/graphics/MatrixKt#(android.graphics.Matrix).values()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Matrix.html receiver)` Returns the 9 values of this `https://developer.android.com/reference/android/graphics/Matrix.html` as a new array of floats. |

## Public methods

### rotationMatrix

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Matrix.kt+function:rotationMatrix) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Matrix rotationMatrix(float degrees, float px, float py)
```

Creates a rotation matrix, defined by a rotation angle in degrees around the pivot point located at the coordinates (`https://developer.android.com/reference/androidx/core/graphics/package-summary#rotationMatrix(kotlin.Float,kotlin.Float,kotlin.Float)`, `https://developer.android.com/reference/androidx/core/graphics/package-summary#rotationMatrix(kotlin.Float,kotlin.Float,kotlin.Float)`).

### scaleMatrix

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Matrix.kt+function:scaleMatrix) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Matrix scaleMatrix(float sx, float sy)
```

Creates a scale matrix with the scale factor `https://developer.android.com/reference/androidx/core/graphics/package-summary#scaleMatrix(kotlin.Float,kotlin.Float)` and `https://developer.android.com/reference/androidx/core/graphics/package-summary#scaleMatrix(kotlin.Float,kotlin.Float)` respectively on the `x` and `y` axis.

### times

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Matrix.kt+function:times) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Matrix times(@NonNull Matrix receiver, @NonNull Matrix m)
```

Multiplies this `https://developer.android.com/reference/android/graphics/Matrix.html` by another matrix and returns the result as a new matrix.

### translationMatrix

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Matrix.kt+function:translationMatrix) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Matrix translationMatrix(float tx, float ty)
```

Creates a translation matrix with the translation amounts `https://developer.android.com/reference/androidx/core/graphics/package-summary#translationMatrix(kotlin.Float,kotlin.Float)` and `https://developer.android.com/reference/androidx/core/graphics/package-summary#translationMatrix(kotlin.Float,kotlin.Float)` respectively on the `x` and `y` axis.

### values

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Matrix.kt+function:values) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull float[] values(@NonNull Matrix receiver)
```

Returns the 9 values of this `https://developer.android.com/reference/android/graphics/Matrix.html` as a new array of floats.