Compartilhar via


Vector.AngleBetween(Vector, Vector) Método

Definição

Recupera o ângulo, expressado em graus, entre os dois vetores especificados.

public:
 static double AngleBetween(System::Windows::Vector vector1, System::Windows::Vector vector2);
public static double AngleBetween (System.Windows.Vector vector1, System.Windows.Vector vector2);
static member AngleBetween : System.Windows.Vector * System.Windows.Vector -> double
Public Shared Function AngleBetween (vector1 As Vector, vector2 As Vector) As Double

Parâmetros

vector1
Vector

O primeiro vetor a ser avaliado.

vector2
Vector

O segundo vetor a ser avaliado.

Retornos

Double

O ângulo, em graus, entre vector1 e vector2.

Exemplos

O exemplo a seguir mostra como usar esse método para obter o ângulo entre duas Vector estruturas.

private Double angleBetweenExample()
{
    Vector vector1 = new Vector(20, 30);
    Vector vector2 = new Vector(45, 70);
    Double angleBetween;

    // angleBetween is approximately equal to 0.9548
    angleBetween = Vector.AngleBetween(vector1, vector2);

    return angleBetween;
}

Aplica-se a