Vector3D.Equality(Vector3D, Vector3D) 演算子


2 つの Vector3D 構造体を比較して、等しいかどうかを確認します。Compares two Vector3D structures for equality.

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



最初に比較する Vector3D 構造体。The first Vector3D structure to compare.


比較する 2 番目の Vector3D 構造体。The second Vector3D structure to compare.


vector1vector2XYZ の各コンポーネントが等しい場合は true。それ以外の場合は falsetrue if the X, Y, and Z components of vector1 and vector2 are equal; false otherwise.

次の例は、オーバーロードされた等値演算子を使用しVector3Dて、2つの構造体が等しいかどうかを確認する方法を示しています。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
' Checks if two Vector3D structures are equal using the overloaded equality operator.

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

areEqual = (vector1 = vector2)
' areEqual is False


Vector3DXY の各プロパティ値が同じである場合、2 つの Z 構造体は等しいと見なされます。Two Vector3D structures are equal if the values of their X, Y, and Z properties are the same.

Vector3D値は、値Doubleを使用して記述されます。Vector3D values are described using Double values. Double値は、操作時に精度が失われる可能性があるため、 Vector3D論理的に等しい2つの値の比較は失敗する可能性があります。Because the value of a Double can lose precision when operated upon, a comparison between two Vector3D values that are logically equal might fail.