Vector.Negate Metodo

Definizione

Nega questo vettore. La grandezza del vettore rimane invariata, ma la direzione diventa 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