Vector(Double, Double) Vector(Double, Double) Vector(Double, Double) Vector(Double, Double) Constructor

Definition

Initialisiert eine neue Instanz der Vector-Struktur.Initializes a new instance of the Vector structure.

public:
 Vector(double x, double y);
public Vector (double x, double y);
new System.Windows.Vector : double * double -> System.Windows.Vector
Public Sub New (x As Double, y As Double)

Parameter

x
Double Double Double Double

Der X-Offset des neuen Vector.The X-offset of the new Vector.

y
Double Double Double Double

Der Y-Offset des neuen Vector.The Y-offset of the new Vector.

Beispiele

Das folgende Beispiel zeigt das Erstellen von zwei Vektoren, und anschließend addiert.The following example shows how to create two vectors and add them together.

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;

}

Gilt für: