How to write an ATan2( ) function?

Blitz3D Forums/Blitz3D Programming/How to write an ATan2( ) function?

Hi,

That's not quite right Halo.

What you need to do is look at the sign of the 2 arguments to work out which 'quadrant' the 2d vector is pointing into.

You then adjust the result of Atan correspondingly.

The problem with plain Atan is that it only has one 'sign' to go on.