共用方式為


Vector3D.Inequality(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 op_Inequality : 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 結構。

傳回

Boolean

如果 vector3D1vector3D2XYZ 元件不同則為 true,否則為 false

範例

下列範例示範如何使用多載不等比較運算子來檢查兩 Vector3D 個 結構是否不相等。

// Checks if two Vector3D structures are not equal using the overloaded inequality operator.

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

areNotEqual = (vector1 != vector2);
// areNotEqual is True
' Checks if two Vector3D structures are not equal using the overloaded inequality operator.

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

areNotEqual = (vector1 <> vector2)
' areNotEqual is True

備註

如果 、 X YZ 屬性的值不同,則兩 Vector3D 個 結構不相等。

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

適用於