Vector3D.UnaryNegation(Vector3D) Betreiber

Definition

Negiert eine Vector3D-Struktur.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

Parameter

vector
Vector3D

Die zu negierende Vector3D-Struktur.The Vector3D structure to negate.

Gibt zurück

Vector3D

Eine Vector3D-Struktur, deren X-, Y- und Z-Koordinate der X- Y- und Z-Koordinate von vector gegenüberliegen.A Vector3D structure with X, Y, and Z values opposite of the X, Y, and Z values of vector.

Beispiele

Im folgenden Beispiel wird gezeigt, wie der überladene Negations Operator verwendet wird, um eine Struktur zu negieren Vector3D .The following example shows how to use the overloaded negation operator to negate a Vector3D structure.

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

Hinweise

Die zurückgegebene- Vector3D Struktur hat dieselbe Größe ( Length ) wie vector , aber ihre Richtung ist das Gegenteil von vector .The returned Vector3D structure has the same magnitude (Length) as vector but its direction is opposite of that of vector.

Gilt für:

Siehe auch