Vector.Negate メソッド

定義

このベクトルを否定します。 ベクトルの大きさは以前と同じですが、その方向は逆になっています。

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

次の例は、このメソッドを使用してベクターを否定する方法を示しています。

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

適用対象

こちらもご覧ください