Vector.Negate Metodo

Definizione

Nega questo vettore. Il vettore ha la stessa grandezza di prima, ma la direzione è ora opposta.

public:
 void Negate();
public void Negate();
member this.Negate : unit -> unit
Public Sub Negate ()

Esempio

Nell'esempio seguente viene illustrato come usare questo metodo per negare un vettore.

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;
}

Si applica a

Vedi anche