Equals Method

# Matrix.Equals Method

.NET Framework (current version)

Determines whether the two specified Matrix structures have the same values.

Namespace:   System.Windows.Media
Assembly:  WindowsBase (in WindowsBase.dll)

NameDescription
Equals(Matrix)

Determines whether the specified Matrix structure is identical to this instance.

Equals(Matrix, Matrix)

Determines whether the two specified Matrix structures are identical.

Equals(Object)

Determines whether the specified Object is a Matrix structure that is identical to this Matrix. (Overrides ValueType.Equals(Object).)

## Remarks

Note

A Matrix stores its values as doubles. Because the value of a Double can lose precision when arithmetic operations are performed on it, a comparison between two Double structures that are logically equal might fail.

## Examples

The following example shows how to check two Matrix structures for equality.

```private void equalityExample()
{

Matrix matrix1 = new Matrix(5, 10, 15, 20, 25, 30);
Matrix matrix2 = new Matrix(5, 10, 15, 20, 25, 30);

Boolean result;

// result is true.
result = (matrix1 == matrix2);

// result is false.
result = (matrix1 != matrix2);

}
```