Hi all,
I hope this question can be admitted here, despite of it has nothing to do with Rainmeter, but it has with lua language. So, I have a well working little lua script and I need to create something similar into another programming language (Delphi). I've started the translation but somewhere I found a math.atan2 function and I don't know what to do with it. I tried this: arctan(x/y). Sometimes it gives the proper result, but in some cases it isn't. I googled the web, but I'm still confused. Can somebody with strong lua knowledge, to tell how this function works? Somewhere I found that it "uses the signs of both parameters to find the quadrant of the result." What means this?
Thanks a lot.
It is currently March 29th, 2024, 10:07 am
math.atan2 question
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
-
- Posts: 407
- Joined: September 20th, 2012, 3:17 pm
- Location: USA - Montana
Re: math.atan2 question
I know little about Lua, but enough to get around and even less of Delphi. However, a few minutes on the Google and I managed to find these links, maybe they'll help you (I've also added a snippet of each site with what I thought was important):
Delphi Basics - ATan Function: Delphi Basics - ATan2 Function: Stack Overflow - Inverse of ATan2 (LUA): *I suggest reading the full post on this one.
Anyway, hopefully this helps you. Like I said I know very little about these particular languages, but I think this is probably what you're looking for.
Delphi Basics - ATan Function:
Anyway, hopefully this helps you. Like I said I know very little about these particular languages, but I think this is probably what you're looking for.
01010100 01100101 01100011 01101000 01101110 01101111 01101100 01101111 01100111 01101001
01100011 01100001 01101100 00100000 01000010 01100001 01100100 01100001 01110011 01110011
01100011 01100001 01101100 00100000 01000010 01100001 01100100 01100001 01110011 01110011
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: math.atan2 question
Thank you, I also tried to find something with Google, but had no success. But this is great, I had no idea about this ArcTan2 Delphi function! Thanks!VasTex wrote:I know little about Lua, but enough to get around and even less of Delphi. However, a few minutes on the Google and I managed to find these links, maybe they'll help you (I've also added a snippet of each site with what I thought was important):
Delphi Basics - ATan Function:Delphi Basics - ATan2 Function:Stack Overflow - Inverse of ATan2 (LUA):*I suggest reading the full post on this one.
Anyway, hopefully this helps you. Like I said I know very little about these particular languages, but I think this is probably what you're looking for.
-
- Posts: 407
- Joined: September 20th, 2012, 3:17 pm
- Location: USA - Montana
Re: math.atan2 question
Happy to help apparently!
01010100 01100101 01100011 01101000 01101110 01101111 01101100 01101111 01100111 01101001
01100011 01100001 01101100 00100000 01000010 01100001 01100100 01100001 01110011 01110011
01100011 01100001 01101100 00100000 01000010 01100001 01100100 01100001 01110011 01110011