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.

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

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.

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

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

.NET Framework 4.8.1 i druge verzije
Proizvod Verzije
.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

Equals(Vector3D)

Compares two Vector3D structures for equality.

C#
public bool Equals(System.Windows.Media.Media3D.Vector3D value);

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

.NET Framework 4.8.1 i druge verzije
Proizvod Verzije
.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

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.

C#
public override bool Equals(object o);

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.

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

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

.NET Framework 4.8.1 i druge verzije
Proizvod Verzije
.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