Vector3D.AngleBetween(Vector3D, Vector3D) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
public:
static double AngleBetween(System::Windows::Media::Media3D::Vector3D vector1, System::Windows::Media::Media3D::Vector3D vector2);
public static double AngleBetween (System.Windows.Media.Media3D.Vector3D vector1, System.Windows.Media.Media3D.Vector3D vector2);
static member AngleBetween : System.Windows.Media.Media3D.Vector3D * System.Windows.Media.Media3D.Vector3D -> double
Public Shared Function AngleBetween (vector1 As Vector3D, vector2 As Vector3D) As Double
參數
傳回
將 vector1
旋轉至 vector2
所需的角度,以度數為單位。
範例
下列範例示範如何取得兩 Vector3D 個 結構之間的角度。
// Calculates the angle between two Vector3Ds using the static AngleBetween method.
// Returns a Double.
Vector3D vector1 = new Vector3D(20, 30, 40);
Vector3D vector2 = new Vector3D(45, 70, 80);
Double angleBetween;
angleBetween = Vector3D.AngleBetween(vector1, vector2 );
// angleBetween is approximately equal to 4.15129
' Calculates the angle between two Vector3Ds using the static AngleBetween method.
' Returns a Double.
Dim vector1 As New Vector3D(20, 30, 40)
Dim vector2 As New Vector3D(45, 70, 80)
Dim angleBetween As Double
angleBetween = Vector3D.AngleBetween(vector1, vector2)
' angleBetween is approximately equal to 4.15129
備註
帶正負號的角度不會延伸到 3D 空間,因此會傳回介於 0 到 180 度之間的角度。