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

적용 대상

추가 정보