Vector.Add 메서드

정의

벡터를 점이나 다른 벡터에 더합니다.

오버로드

Add(Vector, Point)

지정된 벡터에 따라 지정된 점을 변환하고 결과 점을 반환합니다.

Add(Vector, Vector)

두 벡터를 더한 결과를 Vector 구조체로 반환합니다.

Add(Vector, Point)

지정된 벡터에 따라 지정된 점을 변환하고 결과 점을 반환합니다.

public:
 static System::Windows::Point Add(System::Windows::Vector vector, System::Windows::Point point);
public static System.Windows.Point Add (System.Windows.Vector vector, System.Windows.Point point);
static member Add : System.Windows.Vector * System.Windows.Point -> System.Windows.Point
Public Shared Function Add (vector As Vector, point As Point) As Point

매개 변수

vector
Vector

지정된 점을 변환할 크기입니다.

point
Point

변환할 점입니다.

반환

Point

point에 따라 vector를 변환한 결과입니다.

예제

다음 예제에서는이 메서드를 사용 하 여 추가할 방법을 Point 구조체를 Vector 구조입니다.

private Point addPointAndVectorExample()
{
    Vector vector1 = new Vector(20, 30);
    Point point1 = new Point(10, 5);
    Point pointResult = new Point();

    // Add Point and Vector together.
    // pointResult is equal to (30,35).
    pointResult = Vector.Add(vector1, point1);

    return pointResult;
}

추가 정보

적용 대상

Add(Vector, Vector)

두 벡터를 더한 결과를 Vector 구조체로 반환합니다.

public:
 static System::Windows::Vector Add(System::Windows::Vector vector1, System::Windows::Vector vector2);
public static System.Windows.Vector Add (System.Windows.Vector vector1, System.Windows.Vector vector2);
static member Add : System.Windows.Vector * System.Windows.Vector -> System.Windows.Vector
Public Shared Function Add (vector1 As Vector, vector2 As Vector) As Vector

매개 변수

vector1
Vector

더할 첫 번째 벡터입니다.

vector2
Vector

더할 두 번째 벡터입니다.

반환

Vector

vector1vector2의 합입니다.

예제

다음 예제에서는 두 개의 추가 하려면이 메서드를 사용 하는 방법을 보여 줍니다 Vector 구조입니다.

private Vector addTwoVectorsExample()
{
    // Create two Vector structures.
    Vector vector1 = new Vector(20, 30);
    Vector vector2 = new Vector(45, 70);
    Vector vectorResult = new Vector();

    // Add the vectors together. 
    // vectorResult is equal to (65, 100).
    vectorResult = Vector.Add(vector1, vector2);

    return vectorResult;
}

추가 정보

적용 대상