Class Matrix3

Definition

Namespace:
Tizen.NUI
Assembly:
Tizen.NUI.dll

A 3x3 matrix.
The matrix is stored as a flat array and is Column Major, i.e. the storage order is as follows (numbers represent indices of array):

Copy
0 3 6 1 4 7 2 5 8

Each axis is contiguous in memory, so the x-axis corresponds to elements 0, 1, and 2, the y-axis corresponds to elements 3, 4, 5, the z-axis corresponds to elements 6, 7, and 8.

C#
Copy
public class Matrix3 : Disposable
Inheritance
Matrix3

Constructors

View Source

Matrix3()

The constructor initialized as zero.

Declaration
C#
Copy
public Matrix3()
View Source

Matrix3(Single, Single, Single, Single, Single, Single, Single, Single, Single)

The constructor with nine floats.

Declaration
C#
Copy
public Matrix3(float s00, float s01, float s02, float s10, float s11, float s12, float s20, float s21, float s22)
Parameters
Type Name Description
Single s00

Value of 0 column, 0 row.

Single s01

Value of 0 column, 1 row.

Single s02

Value of 0 column, 2 row.

Single s10

Value of 1 column, 0 row.

Single s11

Value of 1 column, 1 row.

Single s12

Value of 1 column, 2 row.

Single s20

Value of 2 column, 0 row.

Single s21

Value of 2 column, 1 row.

Single s22

Value of 2 column, 2 row.

View Source

Matrix3(Matrix)

The constructor.

Declaration
C#
Copy
public Matrix3(Matrix matrix)
Parameters
Type Name Description
Matrix matrix

The matrix to copy value. The translation and shear components are ignored.

View Source

Matrix3(Matrix3)

The constructor.

Declaration
C#
Copy
public Matrix3(Matrix3 matrix)
Parameters
Type Name Description
Matrix3 matrix

The matrix to copy value.

Properties

View Source

Identity

The matrix as identity

Declaration
C#
Copy
public static Matrix3 Identity { get; }
Property Value
Type Description
Matrix3
View Source

Item[UInt32]

Get/set the value of matrix by it's index.

Declaration
C#
Copy
public float this[uint index] { get; set; }
Parameters
Type Name Description
UInt32 index

The index to get/set value.

Property Value
Type Description
Single

Methods

View Source

EqualTo(Matrix3)

Compares if rhs is equal to.

Declaration
C#
Copy
public bool EqualTo(Matrix3 rhs)
Parameters
Type Name Description
Matrix3 rhs

The matrix to compare.

Returns
Type Description
Boolean

Returns true if the two matrixes are equal, otherwise false.

View Source

GetHashCode()

Gets the hash code of this Matrix3.

Declaration
C#
Copy
public override int GetHashCode()
Returns
Type Description
Int32

The Hash Code.

View Source

Invert()

Generic brute force matrix invert.

Declaration
C#
Copy
public bool Invert()
Returns
Type Description
Boolean

True if successful.

View Source

Magnitude()

Magnitude returns the average of the absolute values of the elements * 3.0f. The Magnitude of the unit matrix is therefore 1.

Declaration
C#
Copy
public float Magnitude()
Returns
Type Description
Single

The magnitude - always positive.

View Source

Multiply(Matrix3)

Multiply the Matrix3 and Matrix3.

Declaration
C#
Copy
public Matrix3 Multiply(Matrix3 rhs)
Parameters
Type Name Description
Matrix3 rhs

The right-hand-side Matrix3.

Returns
Type Description
Matrix3

The matrix multiply as this * rhs.

View Source

Multiply(Matrix3, Matrix3, Matrix3)

Function to multiply two matrices and store the result onto third.
Use this method in time critical path as it does not require temporaries.

Declaration
C#
Copy
public static void Multiply(Matrix3 result, Matrix3 lhs, Matrix3 rhs)
Parameters
Type Name Description
Matrix3 result

Result of the multiplication.

Matrix3 lhs

The left-hand-side Matrix3. this can be same matrix as result.

Matrix3 rhs

The right-hand-side Matrix3. this cannot be same matrix as result.

View Source

Multiply(Vector3)

Multiply the Matrix3 and Vector3.

Declaration
C#
Copy
public Vector3 Multiply(Vector3 rhs)
Parameters
Type Name Description
Vector3 rhs

The right-hand-side Vector3.

Returns
Type Description
Vector3

The vector multiply as this * rhs.

View Source

MultiplyAssign(Matrix3)

Multiply the Matrix3 and Matrix3. Result will be stored into this Matrix3.

Declaration
C#
Copy
public void MultiplyAssign(Matrix3 rhs)
Parameters
Type Name Description
Matrix3 rhs

The right-hand-side Matrix3.

View Source

NotEqualTo(Matrix3)

Compares if rhs is not equal to.

Declaration
C#
Copy
public bool NotEqualTo(Matrix3 rhs)
Parameters
Type Name Description
Matrix3 rhs

The matrix to compare.

Returns
Type Description
Boolean

Returns true if the two matrixes are not equal, otherwise false.

View Source

ReleaseSwigCPtr(Runtime.InteropServices.HandleRef)

Declaration
C#
Copy
protected override void ReleaseSwigCPtr(Runtime.InteropServices.HandleRef swigCPtr)
Parameters
Type Name Description
Tizen.System.Runtime.InteropServices.HandleRef swigCPtr
Overrides
View Source

Scale(Single)

Multiplies all elements of the matrix by the scale value.

Declaration
C#
Copy
public void Scale(float scale)
Parameters
Type Name Description
Single scale

The value by which to scale the whole matrix.

View Source

ScaledInverseTranspose()

If the matrix is invertible, then this method inverts, transposes and scales the matrix such that the resultant element values average 1.
If the matrix is not invertible, then the matrix is left unchanged.

Declaration
C#
Copy
public bool ScaledInverseTranspose()
Returns
Type Description
Boolean

True if the matrix is invertable. False otherwise

View Source

SetIdentity()

Make matrix as identity.

Declaration
C#
Copy
public void SetIdentity()
View Source

SetValueAtIndex(UInt32, Single)

Set the value at matrix by it's index.

Declaration
C#
Copy
public void SetValueAtIndex(uint index, float value)
Parameters
Type Name Description
UInt32 index

The index to set value.

Single value

The value to set.

View Source

SetValueAtIndex(UInt32, UInt32, Single)

Set the value at matrix by it's row index and column index.

Declaration
C#
Copy
public void SetValueAtIndex(uint indexRow, uint indexColumn, float value)
Parameters
Type Name Description
UInt32 indexRow

The row index to set value.

UInt32 indexColumn

The column index to set value.

Single value

The value to set.

View Source

Transpose()

Swaps the rows to columns.

Declaration
C#
Copy
public bool Transpose()
Returns
Type Description
Boolean
View Source

ValueOfIndex(UInt32)

Get the value of matrix by it's index.

Declaration
C#
Copy
public float ValueOfIndex(uint index)
Parameters
Type Name Description
UInt32 index

The index to get value.

Returns
Type Description
Single

A value of index

View Source

ValueOfIndex(UInt32, UInt32)

Get the value of matrix by it's row index and column index.

Declaration
C#
Copy
public float ValueOfIndex(uint indexRow, uint indexColumn)
Parameters
Type Name Description
UInt32 indexRow

The row index to get value.

UInt32 indexColumn

The column index to get value.

Returns
Type Description
Single

A value of index

Operators

View Source

Multiply(Matrix3, Matrix3)

Multiply Matrix3 and Matrix3.

Declaration
C#
Copy
public static Matrix3 operator *(Matrix3 lhs, Matrix3 rhs)
Parameters
Type Name Description
Matrix3 lhs

The left-hand-side Matrix3.

Matrix3 rhs

The right-hand-side Matrix3.

Returns
Type Description
Matrix3

The Matrix3 multiply as lhs * rhs.

View Source

Multiply(Matrix3, Vector3)

Multiply Matrix3 and Vector3.

Declaration
C#
Copy
public static Vector3 operator *(Matrix3 lhs, Vector3 rhs)
Parameters
Type Name Description
Matrix3 lhs

The left-hand-side Matrix3.

Vector3 rhs

The right-hand-side Vector3.

Returns
Type Description
Vector3

The vector multiply as lhs * rhs.

Extension Methods