Vector3D.UnaryNegation(Vector3D) 操作员

定义

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

参数

vector
Vector3D

要求反的 Vector3D 结构。

返回

Vector3DXY 值与 vectorZXY 值均相反的 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

适用于

另请参阅