Where's atan2(x,y) ?!?
damir0000
Member, BASIC Posts: 8
I didn't notice until I need it ... where's Math atan2(x,y) function? It's crucial for game development and I can't see it on the list.
Any chances to see it soon?
Comments
Hi @damir0000 I doubt that'll find its way into GSC. But there's a way around it though still using the expression editor algorithms (there is atan, magnitude, vectorToangle already there). What would you want to use it for in your game?
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I need to calculate velocity after collision and atan2 is the only function capable to calc angles with respect to the quadrant the point (x, y) is in. So in order to avoid permutations (checking for positive/negative x and y) I was hoping to simply use behalf of atan2.
Too bad...
@damir0000 I expect you can achieve what you want using the vectorToAngle(x,y) function
I've noticed vectorToAngle(x,y), what does this function return? Is it an equivalent of atan2 or something else? Does it return an angle in radians or degrees?
vectorToAngle(x, y) returns atan2(y, x) converted to degrees.
That's awesome! Thanks for making it clear!