Page 1 of 1
ATAN2 ?
Posted: Sun Sep 14, 2003 12:57 am
by WolfgangS
Hi !
Is it possible to integrate an ATan2 function ?
MFG
WolfgangS
Posted: Mon Sep 15, 2003 1:24 pm
by Fred
Yes.
Posted: Sun Oct 05, 2003 8:58 am
by WolfgangS
Fred wrote:Yes.
And would you implement it in the next version ?
MFG
WolfgangS
Posted: Sun Oct 05, 2003 10:54 am
by Fred
It willn't be done for the next version.
Posted: Thu Oct 16, 2003 12:11 pm
by Road Runner
Just use ASM. The FPU already does ATAN.
I don't know the syntax required for PureBasic in-line ASM but I'm sure someone will show you how to make it work..
Code: Select all
fld y ;Get y onto the FPU stack
fld x ;Get x onto the FPU stack
fpatan ;Get the ATAN(y/x), Put result in ST(1) then pop the stack
fstp res ;store the result in res and pop the stack
Posted: Tue Nov 22, 2005 6:52 pm
by Polo
Fred wrote:It willn't be done for the next version.
It's been 2 years now

Posted: Tue Nov 22, 2005 7:46 pm
by va!n
Polo wrote:Fred wrote:It willn't be done for the next version.
It's been 2 years now


Posted: Tue Nov 22, 2005 7:54 pm
by El_Choni
Shouldn't it be enough to do Atan(y/x)?
Posted: Tue Nov 22, 2005 8:20 pm
by Psychophanta
Yes, no needed more than the basic math functions, else PB would be full of it (Cosh(), Sinh(), Tanh(), Atan2(), ln(), etc.), and that should be too much ugly for a PURE language.

If PB 4 allow macros you can do all those functions in ASM (or get it from this forum) and save it in a good place for your programs.

EDIT: I'm dying to work with macros to build my own module sources.
BTW, ElChoni, are you Tailbite Expert? Shouldn't be better to write Tailbite author?
Posted: Tue Nov 22, 2005 8:45 pm
by Polo
Sorry, but Atan2 is different than atan(y/x), because atan2 should include some checks.
Posted: Tue Nov 22, 2005 10:08 pm
by va!n
why not adding it as keyword when its just only some asm lines? i dont need such a command yet but even blitz basic has inbuild Tan2 support... (looking forward...)
[Edit:]
same for Pi() , Sgn() , MOD, NOT, XOR
