Export (0) Print
Expand All

Vector3D.Equality Operator

Compares two Vector3D structures for equality.

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

public static bool operator ==(
	Vector3D vector1,
	Vector3D vector2
)

Parameters

vector1
Type: System.Windows.Media.Media3D.Vector3D
The first Vector3D structure to compare.
vector2
Type: System.Windows.Media.Media3D.Vector3D
The second Vector3D structure 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 shows how to use the overloaded equality operator to check if two Vector3D structures are equal.


// 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


.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft