Udostępnij za pośrednictwem


Vector3D.AngleBetween(Vector3D, Vector3D) Metoda

Definicja

Pobiera kąt wymagany do obracania pierwszej określonej Vector3D struktury do drugiej określonej Vector3D struktury.

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

Parametry

vector1
Vector3D

Pierwsza Vector3D struktura do oceny.

vector2
Vector3D

Druga Vector3D struktura do oceny.

Zwraca

Double

Kąt w stopniach potrzebny do obrócenia vector1 do vector2.

Przykłady

W poniższym przykładzie pokazano, jak uzyskać kąt między dwiema Vector3D strukturami.

                    // 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

Uwagi

Kąty ze znakiem nie rozciągają się na przestrzeń 3-W, więc zwracany jest kąt z zakresu od 0 do 180 stopni.

Dotyczy