Vector.Negate Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Annule ce vecteur. Le vecteur a la même magnitude que précédemment, mais sa direction est maintenant opposée.
public:
void Negate();
public void Negate();
member this.Negate : unit -> unit
Public Sub Negate ()
Exemples
L’exemple suivant montre comment utiliser cette méthode pour négation d’un vecteur.
private Vector negateExample()
{
Vector vectorResult = new Vector(20, 30);
// Make the direction of the Vector opposite but
// leave the vector magnitude the same.
// vectorResult is equal to (-20, -30)
vectorResult.Negate();
return vectorResult;
}