# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# Matrix2f

`public class Matrix2f`
`extends Object` ``

java.lang.Object
↳ | android.renderscript.Matrix2f

This class is deprecated.
Renderscript has been deprecated in API level 31. Please refer to the migration guide for the proposed alternatives.

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

## Summary

### Public constructors
`Matrix2f()` Creates a new identity 2x2 matrix
`Matrix2f(float[] dataArray)` Creates a new matrix and sets its values from the given parameter

### Public methods
`float` | `get(int x, int y)` Returns the value for a given row and column
`float[]` | `getArray()` Return a reference to the internal array representing matrix values.
`void` | `load(Matrix2f src)` Sets the values of the matrix to those of the parameter
`void` | `loadIdentity()` Sets the matrix values to identity
`void` | `loadMultiply(Matrix2f lhs, Matrix2f rhs)` Sets current values to be the result of multiplying two given matrices
`void` | `loadRotate(float rot)` Sets current values to be a rotation matrix of given angle
`void` | `loadScale(float x, float y)` Sets current values to be a scale matrix of given dimensions
`void` | `multiply(Matrix2f rhs)` Post-multiplies the current matrix by a given parameter
`void` | `rotate(float rot)` Modifies the current matrix by post-multiplying it with a rotation matrix of given angle
`void` | `scale(float x, float y)` Modifies the current matrix by post-multiplying it with a scale matrix of given dimensions
`void` | `set(int x, int y, float v)` Sets the value for a given row and column
`void` | `transpose()` Sets the current matrix to its transpose

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public constructors

### Matrix2f

    public Matrix2f ()

Creates a new identity 2x2 matrix

### Matrix2f

    public Matrix2f (float[] dataArray)

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

Parameters
`dataArray` | `float`: values to set the matrix to, must be 4 floats long

## Public methods

### get

    public float get (int x,
                    int y)

Returns the value for a given row and column

Parameters
`x` | `int`: column of the value to return
`y` | `int`: row of the value to return

Returns
`float` | value in the yth row and xth column

### getArray

    public float[] getArray ()

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

Returns
`float[]` | internal array representing the matrix

### load

    public void load (Matrix2f src)

Sets the values of the matrix to those of the parameter

Parameters
`src` | `Matrix2f`: matrix to load the values from

### loadIdentity

    public void loadIdentity ()

Sets the matrix values to identity

### loadMultiply

    public void loadMultiply (Matrix2f lhs,
                    Matrix2f rhs)

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

Parameters
`lhs` | `Matrix2f`: left hand side matrix
`rhs` | `Matrix2f`: right hand side matrix

### loadRotate

    public void loadRotate (float rot)

Sets current values to be a rotation matrix of given angle

Parameters
`rot` | `float`: rotation angle

### loadScale

    public void loadScale (float x,
                    float y)

Sets current values to be a scale matrix of given dimensions

Parameters
`x` | `float`: scale component x
`y` | `float`: scale component y

### multiply

    public void multiply (Matrix2f rhs)

Post-multiplies the current matrix by a given parameter

Parameters
`rhs` | `Matrix2f`: right hand side to multiply by

### rotate

    public void rotate (float rot)

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

Parameters
`rot` | `float`: angle of rotation

### scale

    public void scale (float x,
                    float y)

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

Parameters
`x` | `float`: scale component x
`y` | `float`: scale component y

### set

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

Sets the value for a given row and column

Parameters
`x` | `int`: column of the value to set
`y` | `int`: row of the value to set
`v` | `float`

### transpose

    public void transpose ()

Sets the current matrix to its transpose

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*