Export (0) Print
Expand All

Vector.AngleBetween Method

Retrieves the angle, expressed in degrees, between the two specified vectors.

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

public static double AngleBetween(
	Vector vector1,
	Vector vector2


Type: System.Windows.Vector

The first vector to evaluate.

Type: System.Windows.Vector

The second vector to evaluate.

Return Value

Type: System.Double
The angle, in degrees, between vector1 and vector2.

The following example shows how to use this method to get the angle between two Vector structures.

private Double angleBetweenExample()
    Vector vector1 = new Vector(20, 30);
    Vector vector2 = new Vector(45, 70);
    Double angleBetween;

    // angleBetween is approximately equal to 0.9548
    angleBetween = Vector.AngleBetween(vector1, vector2);

    return angleBetween;


.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft