Vector3D.LengthSquared Property

 

Gets the square of the length of this Vector3D structure.

Namespace:   System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)

public double LengthSquared { get; }

Property Value

Type: System.Double

The square of the length of this Vector3D structure.

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

The following example shows how to get the square of the length of a Vector3D structure.

// Gets the square of the length of a Vector3D.  
// Returns a Vector3D.

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

lengthSq = vector1.LengthSquared;
                  // lengthSq is equal to 2900

.NET Framework
Available since 3.0
Return to top
Show: