Vector3D.Equals Method (Vector3D, Vector3D)

 

Compares two Vector3D structures for equality.

Namespace:   System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)

public static bool Equals(
	Vector3D vector1,
	Vector3D vector2
)

Parameters

vector1
Type: System.Windows.Media.Media3D.Vector3D

First Vector3D to compare.

vector2
Type: System.Windows.Media.Media3D.Vector3D

Second Vector3D to compare.

Return Value

Type: System.Boolean

true if the X, Y, and Z components of vector1 and vector2 are equal; false otherwise.

Two Vector3D structures are equal if the values of their X, Y, and Z properties are the same.

Vector3D values are described using Double values. Because the value of a Double can lose precision when operated upon, a comparison between two Vector3D values that are logically equal might fail.

The following example checks whether two Vector3D structures are equal.

// Checks if two Vector3D structures are equal using the static Equals method.

Vector3D vector1 = new Vector3D(20, 30, 40);
Vector3D vector2 = new Vector3D(45, 70, 80);
Boolean areEqual;

areEqual = Vector3D.Equals(vector1, vector2);
// areEqual is False	

.NET Framework
Available since 3.0
Return to top
Show: