Vector.Negate 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
能抵消這個向量。 向量大小與之前相同,但方向相反。
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;
}