Kürzer wäre vielleicht noch das hier:
Code: Alles auswählen
Procedure.d Winkel2(x.d, y.d)
Protected a.d = ACos(x / Sqr(x * x + y * y))
If y < 0 : a = -a + 2 * #PI : EndIf
ProcedureReturn a * 180 / #PI
EndProcedure
den ASM-Output anzuschauen.

Code: Alles auswählen
Procedure.d Winkel2(x.d, y.d)
Protected a.d = ACos(x / Sqr(x * x + y * y))
If y < 0 : a = -a + 2 * #PI : EndIf
ProcedureReturn a * 180 / #PI
EndProcedure
Code: Alles auswählen
Procedure.d Winkel2(x.d, y.d)
Protected a.d = ACos(x / Sqr(x * x + y * y))
If y < 0 : a = -a + 2 * #PI : EndIf
ProcedureReturn a * 180 / #PI
EndProcedure
Procedure.d Winkel(x.d,y.d)
Protected Winkel.d = ATan(y/x)/#PI*180
If x < 0 : Winkel + 180 : EndIf
ProcedureReturn Winkel
EndProcedure
a = timeGetTime_()
For n = 1 To 1000000
z.f = Winkel(1,1)
Next n
b = timeGetTime_()-a
c = timeGetTime_()
For n = 1 To 1000000
z.f = Winkel2(1,1)
Next n
d = timeGetTime_()-a
MessageRequester("", "ATan:"+Str(b)+Chr(10)+"ACos:"+Str(d))
Code: Alles auswählen
c = timeGetTime_()
For n = 1 To 1000000
z.f = Winkel2(1,1)
Next n
d = timeGetTime_()-a ;das a is nix gudd, da komme c hin
Code: Alles auswählen
Macro WinkelM(x, y)
(ATan(y / x) / #PI * 180.0 + (x < 0.0 And 1) * 180.0 + (y < 0.0 And x > 0) * 360.0)
EndMacro