# Vector3D.UnaryNegation(Vector3D) 運算子

## 定義

Vector3D 結構加上負號。Negates a Vector3D structure.

``````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 結構，其 XYZ 值與 `vector`XYZ 值正負號相反。A Vector3D structure with X, Y, and Z values opposite of the X, Y, and Z values of `vector`.

## 範例

``````// 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)
``````