Vector3D.UnaryNegation(Vector3D) 操作员
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
对 Vector3D 结构求反。
public:
static System::Windows::Media::Media3D::Vector3D operator -(System::Windows::Media::Media3D::Vector3D vector);
public static System.Windows.Media.Media3D.Vector3D operator - (System.Windows.Media.Media3D.Vector3D vector);
static member ( ~- ) : System.Windows.Media.Media3D.Vector3D -> System.Windows.Media.Media3D.Vector3D
Public Shared Operator - (vector As Vector3D) As Vector3D
参数
返回
其 Vector3D、X 和 Y 值与 vector
的 Z、X 和 Y 值均相反的 Z 结构。
示例
以下示例演示如何使用重载求反运算符来否定 Vector3D 结构。
// Negates a Vector3D using the overloaded unary negation operator.
Vector3D vector1 = new Vector3D(20, 30, 40);
Vector3D vectorResult = new Vector3D();
vectorResult = -vector1;
// vectorResult is equal to (-20, -30, -40)
' Negates a Vector3D using the overloaded unary negation operator.
Dim vector1 As New Vector3D(20, 30, 40)
Dim vectorResult As New Vector3D()
vectorResult = -vector1
' vectorResult is equal to (-20, -30, -40)
注解
返回的结构 Vector3D 具有与) 相同的数量级 (Lengthvector
,但其方向与 相反 vector
。