ATan2

Discuss the future of the AutoHotkey language
User avatar
Animan8000
Posts: 58
Joined: 11 May 2022, 05:00
Contact:

ATan2

23 Jun 2023, 05:51

Added ATan2(y, x). [PR #319 by sswwaagg]
Shouldn't it be ATan2(x, y) instead, to reduce user error and confusion? y, x would just introduce an inconsistency because other functions like Pixel/ImageSearch start with x and then y, instead of the other way around.
lexikos
Posts: 9629
Joined: 30 Sep 2013, 04:07
Contact:

Re: v2.1-alpha.1

24 Jun 2023, 20:09

Perhaps @swagfag knows. I've never needed that function and honestly put zero thought into it.

A quick search shows that this is the common way to do it.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: v2.1-alpha.1

27 Jun 2023, 12:36

x=y=0 should throw as it is not defined. Although y,x are just variable names and we can call them whatever we like, it should probably say y,x in the docs, due to it being conventional. Other conventions exist though, eg, in LibreOffice it is atan2(x,y), which behaves as atan2(y,x) in this new bif. msdn atan2 says y,x.

Cheers.

Return to “AutoHotkey Development”

Who is online

Users browsing this forum: NPerovic and 10 guests