Vector.Negate Método

Definição

Anula este vetor. O vetor tem a mesma magnitude de antes, mas a sua direção é agora oposta.

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

Exemplos

O exemplo seguinte mostra como usar este método para negar um vetor.

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

Aplica-se a

Ver também