Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I've started playing with complex variables (I'm more used to matrix transformations of coordinates than using quaternions or octonions, but I'll definitely try it), and I've noticed than ATN doesn't wot work with complex, that's a bit too bad, I was ready to implement complex ASN and others using atn:

DEF FNASN@(z@) = ATN(z@/SQR(1-z@*z@))

Ideally I would prefer a simple direct calculation and avoid Taylor/McLaurin series in Basic, Newton iterations (I wrote several implementations of CORDIC algorithm, but complex generalization is not simple, and I want to avoid iterations if possible)

---- forget it, searching on the Web how to compute ascsine without arctangent, I've found I can use complex log: arcsin(z) = -i.ln(i.z + √(1 - z²))

DEF FNASN@(z@)=CPLX(0,-1)*LOG(CPLX(0,1)*z@+sqr(1-z@*z@))

and it works, so it's Ok without complex ATN (and it avoids the problem of z=+/-1 with ATN formula)