Italian angolo di direzione

LordZenzo

Well-Known Member
Licensed User
Longtime User
scusate ma non mi viene
avendo due punti vorrei l'angolo di direzione
sto provando cosi

x1=x1-x ' cateto su x
y1=y1-y ' cateto su y
a=Sqrt((x1*x1)+(y1*y1))
b=(x1/a)
c=180*(ASin(b)/3.14159)

a dovrebbe essere la ipotenusa del triangolo rettangolo
b dovrebbe essere il seno dell'angolo in radianti ? o in centesimali ?
c dovrebbe portarlo in gradi da radianti
 
Last edited:

LordZenzo

Well-Known Member
Licensed User
Longtime User

LordZenzo

Well-Known Member
Licensed User
Longtime User
If you have two points, with x1 y1 and x2 y2 as coordinates, the angle between them is:
AngleRad = ATan2(y2 - y1, x2 - x1)
AngleDeg = ATan2D(y2 - y1, x2 - x1)
grazie

la funzione Math.GetTouchAngle(x,y,x1,y1) deve essere corretta con un -90
 

klaus

Expert
Licensed User
Longtime User
The angle definition of ATan2 is:

upload_2016-4-7_15-42-18.png
 
Last edited:
Top