Vector3D.Equality(Vector3D, Vector3D) 運算子
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
比較兩個 Vector3D 結構是否相等。
public:
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
參數
傳回
如果 vector1
和 vector2
的 X、Y 和 Z 元件都相等則為 true
,否則為 false
。
範例
下列範例示範如何使用多載相等運算子來檢查兩 Vector3D 個 結構是否相等。
// 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
備註
兩個 Vector3D 結構的 X、Y 和 Z 屬性若相同,就表示兩個結構相等。
Vector3D 值是使用 Double 值來描述。 因為 的值 Double 在操作時可能會失去精確度,因此邏輯上相等的兩 Vector3D 個值之間的比較可能會失敗。