Vector3D.Normalize Method

Definition

Normalizes the specified Vector3D structure.

C#
public void Normalize();

Examples

The following example shows how to normalize a Vector3D structure.

C#
// Normalizes a Vector3D using the Normalize method.  
// Returns a Vector3D.

Vector3D vector1 = new Vector3D(20, 30, 40);

vector1.Normalize();
// vector1 is approximately equal to (0.37139, 0.55709, 0.74278)

Remarks

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

Applies to

Tuote Versiot
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10