Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Vector.Subtract Method

Subtracts the specified vector from another specified vector.

Namespace:  System.Windows
Assembly:  WindowsBase (in WindowsBase.dll)

public static Vector Subtract(
	Vector vector1,
	Vector vector2
)

Parameters

vector1
Type: System.Windows.Vector

The vector from which vector2 is subtracted.

vector2
Type: System.Windows.Vector

The vector to subtract from vector1.

Return Value

Type: System.Windows.Vector
The difference between vector1 and vector2.

The following example shows how to use this method to subtract a Vector structure from a Vector structure.

private Vector subtractExample()
{

    Vector vector1 = new Vector(20, 30);
    Vector vector2 = new Vector(45, 70);

    // Subtract vector2 from vector1. 
    // vectorResult is equal to (-25, -40)
    Vector vectorResult = Vector.Subtract(vector1, vector2);

    return vectorResult;

}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft