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

적용 대상

추가 정보