ID:135009
 
I've been using this (lifted from Nick's SET library)
proc/arctanh(x)
return log((1 + x) / (1 - x)) / 2

But it fails whenever x is 1 or -1 or whenever it tries to find the log of a negative number. Could we possibly get a hard-coded version of arctan?

In a recent project, I want the player to be able to click a turf and shoot in that direction, which requires getting the angle from the player to the turf.
This will do for you until then... It's trivial to derive the arctan when all you have to work with is arccos and arcsin.

[link]

Also, arctanh is the hyperbolic arctan, which is one of the reasons it's not working as you'd like ;)
In response to tenkuu
tenkuu wrote:
This will do for you until then... It's trivial to derive the arctan when all you have to work with is arccos and arcsin.

[link]

Also, arctanh is the hyperbolic arctan, which is one of the reasons it's not working as you'd like ;)

Thanks! I knew I needed arctan2 but I couldn't find a formula to figure it.