Vector.Addition Vector.Addition Vector.Addition Vector.Addition Operator

定義

オーバーロード

Addition(Vector, Vector) Addition(Vector, Vector) Addition(Vector, Vector) Addition(Vector, Vector)

2 つのベクターを加算し、その結果をベクターとして返します。Adds two vectors and returns the result as a vector.

Addition(Vector, Point) Addition(Vector, Point) Addition(Vector, Point)

指定したベクターでポイントを変換し、その結果のポイントを返します。Translates a point by the specified vector and returns the resulting point.

Addition(Vector, Vector) Addition(Vector, Vector) Addition(Vector, Vector) Addition(Vector, Vector)

2 つのベクターを加算し、その結果をベクターとして返します。Adds two vectors and returns the result as a vector.

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

パラメーター

vector1
Vector Vector Vector Vector

加算する最初のベクトル。The first vector to add.

vector2
Vector Vector Vector Vector

加算する 2 番目のベクトル。The second vector to add.

戻り値

vector1vector2 の合計。The sum of vector1 and vector2.

次の例は、この演算子 (+) を使用して、2 つ追加する方法を示しています。Vector構造体と戻り値、Vectorします。The following example shows how to use this operator (+) to add two Vector structures and return a Vector.

private Vector overloadedAdditionOperatorExample1()
{
    Vector vector1 = new Vector(20, 30);
    Vector vector2 = new Vector(45, 70);
    Vector vectorResult = new Vector();

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

    return vectorResult;

}
Private Function overloadedAdditionOperatorExample1() As Vector
	Dim vector1 As New Vector(20, 30)
	Dim vector2 As New Vector(45, 70)
	Dim vectorResult As New Vector()

	' Add the two vectors together.
	' vectorResult is equal to (65,100)
	vectorResult = vector1 + vector2

	Return vectorResult

End Function
こちらもご覧ください

Addition(Vector, Point) Addition(Vector, Point) Addition(Vector, Point)

指定したベクターでポイントを変換し、その結果のポイントを返します。Translates a point by the specified vector and returns the resulting point.

public:
 static System::Windows::Point operator +(System::Windows::Vector vector, System::Windows::Point point);
public static System.Windows.Point operator + (System.Windows.Vector vector, System.Windows.Point point);
static member ( + ) : System.Windows.Vector * System.Windows.Point -> System.Windows.Point

パラメーター

vector
Vector Vector Vector Vector

point を変換するために使用されるベクター。The vector used to translate point.

point
Point Point Point Point

変換対象のポイント。The point to translate.

戻り値

pointvector によって変換した結果。The result of translating point by vector.

次の例では、この演算子 (+) を使用して変換する方法を示しています、Point構造体をVector構造体。The following example shows how to use this operator (+) to translate a Point structure to a Vector structure.

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

    // Add the point to the vector.
    // pointResult is equal to (30,35).
    pointResult = point1 + vector1;

    return pointResult;

}
Private Function overloadedAdditionOperatorExample2() As Point
	Dim point1 As New Point(10, 5)
	Dim vector1 As New Vector(20, 30)
	Dim pointResult As New Point()

	' Add the point to the vector.
	' pointResult is equal to (30,35).
	pointResult = point1 + vector1

	Return pointResult

End Function
こちらもご覧ください

適用対象