Usando Sin-1 o pecado inverso en python
Aquí está mi código:
# point of intersection between opposite and hypotenuse
x,y = pygame.mouse.get_pos()
# using formula for length of line
lenline1 = (x-x)**2 + (300-y)**2
lenline2 = (x-700)**2 + (y-300)**2
opposite = math.sqrt(lenline1)
adjacent = math.sqrt(lenline2)
# Converting length of lines to angle
PQ = opposite/adjacent
k = math.sin(PQ)
j = math.asin(k)
print(j)
No estoy obteniendo los resultados que esperaba, aunque después de perder el tiempo me acerqué, pero no fue del todo correcto. ¿Podría alguien decirme qué estoy haciendo mal? Tengo dos líneas: opuesta y adyacente. Y deseo obtener el ángulo usando la inversa del pecado. Qué estoy haciendo mal. Solo soy un principiante, así que no des información muy detallada. No puedo imaginar que esto sea difícil de hacer.
Gracias.