#atan2
1 messages · Page 1 of 1 (latest)
try “math.atan2”?
I’ve found the trig functions can be accessed with math. as a prefix but I’ve no clue if atan2 is there
Nope.
huh!
the argument function in lua’s complex number library might work? it depends whether it’s here http://philippe.castagliola.free.fr/LUA/complex.html
you’ll have to give the input as a complex number but it should be functionally identical
oh hold on
yeah no i don’t think this is something built into lua
In the version of Lua I’m using in the game, it’s just atan(y,x)
It would still be nice to have the atan2 function as an alternative or to mention the 2-argument atan in the documentation to avoid confusion.
many things should be mentioned in the docs tbh
the docs seem more of a starting point atm than a full guide
I'll add more to the docs, beyond covering more functions (like this one), are there other big things that come to mind?
the notation where you can write stuff like ‘return x == y and 3’ to make everything that satisfies x == y return 3 is pretty integral to minimising code size
obviously there’s likely a better way to put it, but
I think having something about it in the docs would be good because you kinda need it to get the higher scores