Windows apps
Collapse the table of content
Expand the table of content
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.Length Property

 

Gets the length of this vector.

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

public double Length { get; }

Property Value

Type: System.Double

The length of this vector.

The length of a vector is sometimes referred to as the magnitude.

The following example shows how use this property to get the length of a vector.

private Double lengthExample()
{  

    Vector vector1 = new Vector(20, 30);

    // Get the length of the vector.
    // length is approximately equal to 36.0555
    Double lengthResult = vector1.Length;

    return lengthResult;

}

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft