Windows apps
Collapse the table of content
Expand the table of content
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.Normalize Method ()


Normalizes this vector.

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

public void Normalize()

A normalized vector maintains its direction but its Length becomes 1. The resulting vector is often called a unit vector. A vector is normalized by dividing the vector by its own Length.

The following example shows how to use this method to normalize a vector.

private Vector normalizeExample()
    Vector vectorResult = new Vector(20, 30);

    // A normalized vector maintains its direction but 
    // its length becomes 1. 
    // vectorResult is approximately equal to (0.5547,0.8321).

    return vectorResult;


.NET Framework
Available since 3.0
Return to top
© 2017 Microsoft