Partager via


Vector3D.AngleBetween(Vector3D, Vector3D) Méthode

Définition

Récupère l’angle requis pour faire pivoter la première structure spécifiée Vector3D dans la deuxième structure spécifiée Vector3D .

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

Paramètres

vector1
Vector3D

Première structure Vector3D à évaluer.

vector2
Vector3D

Deuxième structure Vector3D à évaluer.

Retours

Angle en degrés requis pour faire pivoter vector1 dans vector2.

Exemples

L’exemple suivant montre comment obtenir l’angle entre deux Vector3D structures.

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

Remarques

Les angles signés ne s’étendent pas dans l’espace 3D, donc un angle compris entre 0 et 180 degrés est retourné.

S’applique à