Editar

Compartilhar via


Vector3D.Equals Method

Definition

Compares two Vector3D structures for equality.

Overloads

Equals(Vector3D, Vector3D)

Compares two Vector3D structures for equality.

Equals(Vector3D)

Compares two Vector3D structures for equality.

Equals(Object)

Determines whether the specified object is a Vector3D structure and whether the X, Y, and Z properties of the specified Object are equal to the X, Y, and Z properties of this Vector3D structure.

Equals(Vector3D, Vector3D)

Compares two Vector3D structures for equality.

public:
 static bool Equals(System::Windows::Media::Media3D::Vector3D vector1, System::Windows::Media::Media3D::Vector3D vector2);
public static bool Equals (System.Windows.Media.Media3D.Vector3D vector1, System.Windows.Media.Media3D.Vector3D vector2);
static member Equals : System.Windows.Media.Media3D.Vector3D * System.Windows.Media.Media3D.Vector3D -> bool
Public Shared Function Equals (vector1 As Vector3D, vector2 As Vector3D) As Boolean

Parameters

vector1
Vector3D

First Vector3D to compare.

vector2
Vector3D

Second Vector3D to compare.

Returns

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

Examples

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
' Checks if two Vector3D structures are equal using the static Equals method.

Dim vector1 As New Vector3D(20, 30, 40)
Dim vector2 As New Vector3D(45, 70, 80)
Dim areEqual As Boolean

areEqual = Vector3D.Equals(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.

See also

Applies to

Equals(Vector3D)

Compares two Vector3D structures for equality.

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

Parameters

value
Vector3D

The instance of Vector to compare against this instance.

Returns

true if instances are equal; otherwise, false.

Remarks

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.

See also

Applies to

Equals(Object)

Determines whether the specified object is a Vector3D structure and whether the X, Y, and Z properties of the specified Object are equal to the X, Y, and Z properties of this Vector3D structure.

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 Vector3D structure and is identical with this Vector3D structure; false otherwise.

Examples

The following example shows how to check if an Object and a Vector3D structure are equal.

// Compares an Object and a Vector3D for equality using the non-static Equals method.

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

areEqual = vector1.Equals(vector2);
// areEqual is False
' Compares an Object and a Vector3D for equality using the non-static Equals method.

Dim vector1 As New Vector3D(20, 30, 40)
Dim vector2 As New Vector3D(45, 70, 80)
Dim areEqual As Boolean

areEqual = vector1.Equals(vector2)
' areEqual is False

Remarks

If o is not a Vector3D structure, this method returns false.

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.

See also

Applies to