Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,767 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
missing atan2 function #156441
09/23/07 08:06
09/23/07 08:06
Joined: Oct 2006
Posts: 106
i_program_games Offline OP
Member
i_program_games  Offline OP
Member

Joined: Oct 2006
Posts: 106
Here is an atan2 function till the one mentioned in the documentation shows up.

function atan2(var nY,var nX)
{
var nPI = 180;

if(nX > 0)//first or forth quadrent
{
return(atan(nY/nX));
}

if(nX<0)//second or third quadrent
{
if(nY>=0)//second quadrent
{
return(atan(nY/nX)+nPI);
}
else //y<0 //third quadrant
{
return(abs(atan(nY/nX))+nPI);
}

}
else //x=0;
{
if(nY>0)
{
return(nPI/2);
}

if(nY<0)
{
return(-(nPI/2));
}
else //y=0
{
//undefined
}
}

}


Chaos is a paradox consistently inconsistent.
Re: missing atan2 function [Re: i_program_games] #156442
09/23/07 11:37
09/23/07 11:37
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Quote:

Here is an atan2 function till the one mentioned in the documentation shows up.



it has, its called "atan2v", but i haven't done much with it.
it didn't seem to work, though, when i just tried to use it to replace my atan2.

still, good onya

julz


Formerly known as JulzMighty.
I made KarBOOM!
Re: missing atan2 function [Re: JibbSmart] #156443
09/23/07 16:41
09/23/07 16:41
Joined: Oct 2006
Posts: 106
i_program_games Offline OP
Member
i_program_games  Offline OP
Member

Joined: Oct 2006
Posts: 106
Ah, thanks for letting me know


Chaos is a paradox consistently inconsistent.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1