Editar

Compartir a través de


Matrix.Equals Method

Definition

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

Overloads

Equals(Object)

Determines whether the specified Object is a Matrix structure that is identical to this Matrix.

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.

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);
}

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.

Equals(Object)

Determines whether the specified Object is a Matrix structure that is identical to this Matrix.

public:
 override bool Equals(System::Object ^ o);
public override bool Equals (object o);
override this.Equals : obj -> bool
Public Overrides Function Equals (o As Object) As Boolean

Parameters

o
Object

The Object to compare.

Returns

true if o is a Matrix structure that is identical to this Matrix structure; otherwise, false.

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);
}

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.

See also

Applies to

Equals(Matrix)

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

public:
 bool Equals(System::Windows::Media::Matrix value);
public bool Equals (System.Windows.Media.Matrix value);
override this.Equals : System.Windows.Media.Matrix -> bool
Public Function Equals (value As Matrix) As Boolean

Parameters

value
Matrix

The instance of Matrix to compare to this instance.

Returns

true if instances are equal; otherwise, false.

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);
}

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.

See also

Applies to

Equals(Matrix, Matrix)

Determines whether the two specified Matrix structures are identical.

public:
 static bool Equals(System::Windows::Media::Matrix matrix1, System::Windows::Media::Matrix matrix2);
public static bool Equals (System.Windows.Media.Matrix matrix1, System.Windows.Media.Matrix matrix2);
static member Equals : System.Windows.Media.Matrix * System.Windows.Media.Matrix -> bool
Public Shared Function Equals (matrix1 As Matrix, matrix2 As Matrix) As Boolean

Parameters

matrix1
Matrix

The first Matrix structure to compare.

matrix2
Matrix

The second Matrix structure to compare.

Returns

true if matrix1 and matrix2 are identical; otherwise, false.

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.

See also

Applies to