Vector.Negate Método

Definición

Niega este vector. El vector tiene la misma magnitud que antes, pero ahora su dirección es la contraria.

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

Ejemplos

En el ejemplo siguiente se muestra cómo usar este método para negar un vector.

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

Se aplica a

Consulte también