RE:Ayuda para calcular angulos entre tres puntos
Este es un problema más de geometria que de informática, no obstante ahí va
Falla en algunas ocasiones, debe depender del cuadrante en que se encuentre, con esto tienes la idea que puedes refinar.
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If x1 = 0 Then x1 = X: y1 = Y: Exit Sub
If x2 = 0 Then x2 = X: y2 = Y: Line (x1, y1)-(x2, y2): Exit Sub
If x3 = 0 Then x3 = X: y3 = Y: Line (x2, y2)-(x3, y3): Angulo
End Sub
Con esto dibujamos el angulo
Sub Angulo()
Dim Ang1 As Double, Ang2 As Double, Ang As Double
Ang1 = Atn((x1 - x2) / (y1 - y2)) * 180 / 3.1416
Ang2 = Atn((x3 - x2) / (y3 - y2)) * 180 / 3.1416
Ang = ((Ang1) - (Ang2))
Print
Print Ang
End Sub
Con esto imprimimos el Angulo
Private Sub Command1_Click()
x1 = 0: y1 = 0
x2 = 0: y2 = 0
x3 = 0: y3 = 0
Cls
End Sub
Con esto volvemos a empezar