ATAN2 ?

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
WolfgangS
Enthusiast
Enthusiast
Posts: 174
Joined: Fri Apr 25, 2003 3:30 pm

ATAN2 ?

Post by WolfgangS »

Hi !
Is it possible to integrate an ATan2 function ?

MFG
WolfgangS
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Yes.
WolfgangS
Enthusiast
Enthusiast
Posts: 174
Joined: Fri Apr 25, 2003 3:30 pm

Post by WolfgangS »

Fred wrote:Yes.
And would you implement it in the next version ?

MFG
WolfgangS
WolfgangS' projects http://www.schliess.net
Quotation of the month:
<p3hicy>oder ich hol mir so eine geile aus asien
<p3hicy>die ständig poppen will
<p3hicy>'n brötchen pro tag reicht doch
<p3hicy>die essen eh' nich so viel
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

It willn't be done for the next version.
Road Runner
User
User
Posts: 48
Joined: Tue Oct 07, 2003 3:10 pm

Post 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
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

Fred wrote:It willn't be done for the next version.
It's been 2 years now :)
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

Polo wrote:
Fred wrote:It willn't be done for the next version.
It's been 2 years now :)
:wink:
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

Shouldn't it be enough to do Atan(y/x)?
El_Choni
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post 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. :wink:
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. :wink:
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?
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

Sorry, but Atan2 is different than atan(y/x), because atan2 should include some checks.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post 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 :wink:
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Post Reply