Vector3D.Inequality(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 op_Inequality : System.Windows.Media.Media3D.Vector3D * System.Windows.Media.Media3D.Vector3D -> bool
Public Shared Operator != (vector1 As Vector3D, vector2 As Vector3D) As Boolean
参数
返回
如果 vector3D1
和 vector3D2
的 X、Y 和 Z 分量不相等,则为 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 个值之间的比较可能会失败。