Table of Contents

Class Matrix

Namespace
iText.Kernel.Geom
Assembly
itext.kernel.dll

Keeps all the values of a 3 by 3 matrix and allows you to do some math with matrices.

public class Matrix
Inheritance
Matrix
Inherited Members

Constructors

Matrix()

constructs a new Matrix with identity.

public Matrix()

Matrix(float, float)

Constructs a matrix that represents translation.

public Matrix(float tx, float ty)

Parameters

tx float

x-axis translation

ty float

y-axis translation

Matrix(float, float, float, float, float, float)

Creates a Matrix with 6 specified entries.

public Matrix(float a, float b, float c, float d, float e, float f)

Parameters

a float

element at (1,1)

b float

element at (1,2)

c float

element at (2,1)

d float

element at (2,2)

e float

element at (3,1)

f float

element at (3,2)

Remarks

Creates a Matrix with 6 specified entries. The third column will always be [0 0 1] (row, column)

Matrix(float, float, float, float, float, float, float, float, float)

Creates a Matrix with 9 specified entries.

public Matrix(float e11, float e12, float e13, float e21, float e22, float e23, float e31, float e32, float e33)

Parameters

e11 float

element at position (1,1)

e12 float

element at position (1,2)

e13 float

element at position (1,3)

e21 float

element at position (2,1)

e22 float

element at position (2,2)

e23 float

element at position (2,3)

e31 float

element at position (3,1)

e32 float

element at position (3,2)

e33 float

element at position (3,3)

Fields

I11

the row=1, col=1 position ('a') in the matrix.

public const int I11 = 0

Field Value

int

I12

the row=1, col=2 position ('b') in the matrix.

public const int I12 = 1

Field Value

int

I13

the row=1, col=3 position (always 0 for 2-D) in the matrix.

public const int I13 = 2

Field Value

int

I21

the row=2, col=1 position ('c') in the matrix.

public const int I21 = 3

Field Value

int

I22

the row=2, col=2 position ('d') in the matrix.

public const int I22 = 4

Field Value

int

I23

the row=2, col=3 position (always 0 for 2-D) in the matrix.

public const int I23 = 5

Field Value

int

I31

the row=3, col=1 ('e', or X translation) position in the matrix.

public const int I31 = 6

Field Value

int

I32

the row=3, col=2 ('f', or Y translation) position in the matrix.

public const int I32 = 7

Field Value

int

I33

the row=3, col=3 position (always 1 for 2-D) in the matrix.

public const int I33 = 8

Field Value

int

Methods

Add(Matrix)

Adds a matrix from this matrix and returns the results.

public virtual Matrix Add(Matrix arg)

Parameters

arg Matrix

the matrix to subtract from this matrix

Returns

Matrix

a Matrix object

Equals(object)

Checks equality of matrices.

public override bool Equals(object obj)

Parameters

obj object

the other Matrix that needs to be compared with this matrix.

Returns

bool

true if both matrices are equal

See Also

Get(int)

Gets a specific value inside the matrix.

public virtual float Get(int index)

Parameters

index int

an array index corresponding with a value inside the matrix

Returns

float

the value at that specific position.

Remarks

Gets a specific value inside the matrix.

For reference, the indeces are as follows:
I11 I12 I13
I21 I22 I23
I31 I32 I33

GetDeterminant()

Computes the determinant of the matrix.

public virtual float GetDeterminant()

Returns

float

the determinant of the matrix

GetHashCode()

Generates a hash code for this object.

public override int GetHashCode()

Returns

int

the hash code of this object

See Also

Multiply(Matrix)

multiplies this matrix by 'b' and returns the result.

public virtual Matrix Multiply(Matrix by)

Parameters

by Matrix

The matrix to multiply by

Returns

Matrix

the resulting matrix

Remarks

multiplies this matrix by 'b' and returns the result. See http://en.wikipedia.org/wiki/Matrix_multiplication

Subtract(Matrix)

Subtracts a matrix from this matrix and returns the results.

public virtual Matrix Subtract(Matrix arg)

Parameters

arg Matrix

the matrix to subtract from this matrix

Returns

Matrix

a Matrix object

ToString()

Generates a String representation of the matrix.

public override string ToString()

Returns

string

the values, delimited with tabs and newlines.

See Also