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 结构。

返回

如果 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

注解

如果两个Vector3D结构 、 和 Z 属性的值不同,Y则两X个结构不相等。

Vector3D 值是使用值描述的 Double 。 由于 的值 Double 在操作时可能会失去精度,因此在逻辑上相等的两 Vector3D 个值之间的比较可能会失败。

适用于