Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/renderscript/Matrix3f#pubctors) \| [Methods](https://developer.android.com/reference/android/renderscript/Matrix3f#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/renderscript/Matrix3f#inhmethods)

# Matrix3f

*** ** * ** ***

` public class Matrix3f `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.renderscript.Matrix3f |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 31.**   

Renderscript has been deprecated in API level 31. Please refer to the [migration guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.

Class for exposing the native RenderScript rs_matrix3x3 type back to the Android system.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/renderscript/Matrix3f#Matrix3f()() ` Creates a new identity 3x3 matrix |
| ` https://developer.android.com/reference/android/renderscript/Matrix3f#Matrix3f(float[])(float[] dataArray) ` Creates a new matrix and sets its values from the given parameter |

| ### Public methods ||
|---|---|
| ` float` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#get(int,%20int)(int x, int y) ` Returns the value for a given row and column |
| ` float[]` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#getArray()() ` Return a reference to the internal array representing matrix values. |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#load(android.renderscript.Matrix3f)(https://developer.android.com/reference/android/renderscript/Matrix3f src) ` Sets the values of the matrix to those of the parameter |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#loadIdentity()() ` Sets the matrix values to identity |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#loadMultiply(android.renderscript.Matrix3f,%20android.renderscript.Matrix3f)(https://developer.android.com/reference/android/renderscript/Matrix3f lhs, https://developer.android.com/reference/android/renderscript/Matrix3f rhs) ` Sets current values to be the result of multiplying two given matrices |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#loadRotate(float,%20float,%20float,%20float)(float rot, float x, float y, float z) ` Sets current values to be a rotation matrix of certain angle about a given axis |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#loadRotate(float)(float rot) ` Makes the upper 2x2 a rotation matrix of the given angle |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#loadScale(float,%20float)(float x, float y) ` Makes the upper 2x2 a scale matrix of given dimensions |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#loadScale(float,%20float,%20float)(float x, float y, float z) ` Sets current values to be a scale matrix of given dimensions |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#loadTranslate(float,%20float)(float x, float y) ` Sets current values to be a translation matrix of given dimensions |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#multiply(android.renderscript.Matrix3f)(https://developer.android.com/reference/android/renderscript/Matrix3f rhs) ` Post-multiplies the current matrix by a given parameter |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#rotate(float)(float rot) ` Modifies the upper 2x2 of the current matrix by post-multiplying it with a rotation matrix of given angle |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#rotate(float,%20float,%20float,%20float)(float rot, float x, float y, float z) ` Modifies the current matrix by post-multiplying it with a rotation matrix of certain angle about a given axis |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#scale(float,%20float)(float x, float y) ` Modifies the upper 2x2 of the current matrix by post-multiplying it with a scale matrix of given dimensions |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#scale(float,%20float,%20float)(float x, float y, float z) ` Modifies the current matrix by post-multiplying it with a scale matrix of given dimensions |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#set(int,%20int,%20float)(int x, int y, float v) ` Sets the value for a given row and column |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#translate(float,%20float)(float x, float y) ` Modifies the current matrix by post-multiplying it with a translation matrix of given dimensions |
| ` void` | ` https://developer.android.com/reference/android/renderscript/Matrix3f#transpose()() ` Sets the current matrix to its transpose |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### Matrix3f

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Matrix3f ()
```

Creates a new identity 3x3 matrix

<br />

### Matrix3f

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Matrix3f (float[] dataArray)
```

Creates a new matrix and sets its values from the given parameter

<br />

| Parameters ||
|---|---|
| `dataArray` | `float`: values to set the matrix to, must be 9 floats long <br /> |

## Public methods

### get

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float get (int x, 
                int y)
```

Returns the value for a given row and column

<br />

| Parameters ||
|---|---|
| `x` | `int`: column of the value to return <br /> |
| `y` | `int`: row of the value to return <br /> |

| Returns ||
|---|---|
| `float` | value in the yth row and xth column <br /> |

### getArray

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float[] getArray ()
```

Return a reference to the internal array representing matrix values. Modifying this array will also change the matrix

<br />

| Returns ||
|---|---|
| `float[]` | internal array representing the matrix <br /> |

### load

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void load (Matrix3f src)
```

Sets the values of the matrix to those of the parameter

<br />

| Parameters ||
|---|---|
| `src` | `Matrix3f`: matrix to load the values from <br /> |

### loadIdentity

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void loadIdentity ()
```

Sets the matrix values to identity

<br />

### loadMultiply

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void loadMultiply (Matrix3f lhs, 
                Matrix3f rhs)
```

Sets current values to be the result of multiplying two given matrices

<br />

| Parameters ||
|---|---|
| `lhs` | `Matrix3f`: left hand side matrix <br /> |
| `rhs` | `Matrix3f`: right hand side matrix <br /> |

### loadRotate

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void loadRotate (float rot, 
                float x, 
                float y, 
                float z)
```

Sets current values to be a rotation matrix of certain angle about a given axis

<br />

| Parameters ||
|---|---|
| `rot` | `float`: angle of rotation <br /> |
| `x` | `float`: rotation axis x <br /> |
| `y` | `float`: rotation axis y <br /> |
| `z` | `float`: rotation axis z <br /> |

### loadRotate

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void loadRotate (float rot)
```

Makes the upper 2x2 a rotation matrix of the given angle

<br />

| Parameters ||
|---|---|
| `rot` | `float`: rotation angle <br /> |

### loadScale

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void loadScale (float x, 
                float y)
```

Makes the upper 2x2 a scale matrix of given dimensions

<br />

| Parameters ||
|---|---|
| `x` | `float`: scale component x <br /> |
| `y` | `float`: scale component y <br /> |

### loadScale

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void loadScale (float x, 
                float y, 
                float z)
```

Sets current values to be a scale matrix of given dimensions

<br />

| Parameters ||
|---|---|
| `x` | `float`: scale component x <br /> |
| `y` | `float`: scale component y <br /> |
| `z` | `float`: scale component z <br /> |

### loadTranslate

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void loadTranslate (float x, 
                float y)
```

Sets current values to be a translation matrix of given dimensions

<br />

| Parameters ||
|---|---|
| `x` | `float`: translation component x <br /> |
| `y` | `float`: translation component y <br /> |

### multiply

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void multiply (Matrix3f rhs)
```

Post-multiplies the current matrix by a given parameter

<br />

| Parameters ||
|---|---|
| `rhs` | `Matrix3f`: right hand side to multiply by <br /> |

### rotate

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void rotate (float rot)
```

Modifies the upper 2x2 of the current matrix by post-multiplying it with a rotation matrix of given angle

<br />

| Parameters ||
|---|---|
| `rot` | `float`: angle of rotation <br /> |

### rotate

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void rotate (float rot, 
                float x, 
                float y, 
                float z)
```

Modifies the current matrix by post-multiplying it with a rotation matrix of certain angle about a given axis

<br />

| Parameters ||
|---|---|
| `rot` | `float`: angle of rotation <br /> |
| `x` | `float`: rotation axis x <br /> |
| `y` | `float`: rotation axis y <br /> |
| `z` | `float`: rotation axis z <br /> |

### scale

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void scale (float x, 
                float y)
```

Modifies the upper 2x2 of the current matrix by post-multiplying it with a scale matrix of given dimensions

<br />

| Parameters ||
|---|---|
| `x` | `float`: scale component x <br /> |
| `y` | `float`: scale component y <br /> |

### scale

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void scale (float x, 
                float y, 
                float z)
```

Modifies the current matrix by post-multiplying it with a scale matrix of given dimensions

<br />

| Parameters ||
|---|---|
| `x` | `float`: scale component x <br /> |
| `y` | `float`: scale component y <br /> |
| `z` | `float`: scale component z <br /> |

### set

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void set (int x, 
                int y, 
                float v)
```

Sets the value for a given row and column

<br />

| Parameters ||
|---|---|
| `x` | `int`: column of the value to set <br /> |
| `y` | `int`: row of the value to set <br /> |
| `v` | `float` <br /> |

### translate

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void translate (float x, 
                float y)
```

Modifies the current matrix by post-multiplying it with a translation matrix of given dimensions

<br />

| Parameters ||
|---|---|
| `x` | `float`: translation component x <br /> |
| `y` | `float`: translation component y <br /> |

### transpose

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void transpose ()
```

Sets the current matrix to its transpose

<br />