Vector3D.LengthSquared 属性

定义

获取此 Vector3D 结构的长度的平方。

public:
 property double LengthSquared { double get(); };
public double LengthSquared { get; }
member this.LengthSquared : double
Public ReadOnly Property LengthSquared As Double

属性值

Vector3D 结构的长度的平方。

示例

以下示例演示如何获取结构的长度的 Vector3D 平方。

// 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
' Gets the square of the length of a Vector3D.  
' Returns a Vector3D.

Dim vector1 As New Vector3D(20, 30, 40)
Dim lengthSq As Double

lengthSq = vector1.LengthSquared
' lengthSq is equal to 2900

注解

Vector3D 长度有时称为数量级。

适用于