共用方式為


Vector3D.Equality(Vector3D, Vector3D) 運算子

定義

比較兩個 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
Vector3D

要比較的第一個 Vector3D 結構。

vector2
Vector3D

要比較的第二個 Vector3D 結構。

傳回

如果 vector1vector2XYZ 元件都相等則為 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 結構的 XYZ 屬性若相同,就表示兩個結構相等。

Vector3D 值是使用 Double 值來描述。 因為 的值 Double 在操作時可能會失去精確度,因此邏輯上相等的兩 Vector3D 個值之間的比較可能會失敗。

適用於

另請參閱