Vector3D.Equality(Vector3D, Vector3D) Operator

Definition

Compares two Vector3D structures for equality.

C#
public static bool operator ==(System.Windows.Media.Media3D.Vector3D vector1, System.Windows.Media.Media3D.Vector3D vector2);

Parameters

vector1
Vector3D

The first Vector3D structure to compare.

vector2
Vector3D

The second Vector3D structure to compare.

Returns

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

Examples

The following example shows how to use the overloaded equality operator to check if two Vector3D structures are equal.

C#
// Checks if two Vector3D structures are equal using the overloaded equality operator.

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

areEqual = (vector1 == vector2);
// areEqual is False

Remarks

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.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also