Partager via


Vector3D.UnaryNegation(Vector3D) Opérateur

Définition

Nie une structure 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

Paramètres

vector
Vector3D

Structure Vector3D à nier.

Retours

Vector3D

Structure Vector3D avec des valeurs X, Y et Z opposées aux valeurs X, Y et Z de vector.

Exemples

L’exemple suivant montre comment utiliser l’opérateur de négation surchargé pour annuler une 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)

Remarques

La structure retournée Vector3D a la même magnitude (Length) que vector mais sa direction est opposée à celle de vector.

S’applique à

Voir aussi