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