SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

Thread Tools Display Modes
Old 21/10/2009, 09:49 PM   #1
Little Clucker
Join Date: Jan 2008
Posts: 25
Reputation: 0
Default asin. acos, atan, atan2

if(strcmp(cmd, "/position", true) == 0 || strcmp(cmd, "/pos", true) == 0)
	  new Float:px,Float:py,Float:pz,Float:pa,pi,pw;
	  pi = GetPlayerInterior(playerid);
	  pw = GetPlayerVirtualWorld(playerid);
	  if(PlayerInfo[playerid][pLanguage] == 0)
	  	format(string, sizeof(string), "Position: %.4f,%.4f,%.4f %.4f | INT: %d | VirtualWorld %d", px,py,pz,pa,pi,pw);
			format(string, sizeof(string), "TG-: %.4f | TG: %.4f", atan(360-pa),atan(pa));

		if(PlayerInfo[playerid][pLanguage] == 1)
	  	format(string, sizeof(string), "Pozíciód: %.4f,%.4f,%.4f %.4f | INT: %d | Virtuális Világ %d", px,py,pz,pa,pi,pw);
      new Float:tng = asin(pa)/acos(pa);
			format(string, sizeof(string), "TG-: %.4f | TG: %.4f | TG: %.4f | Sin: %.4f | Cos: %.4f | Tan2: %.4f", atan(360-pa),atan(pa),tng,asin(pa),acos(pa),atan2(px,py));
	  return 1;
when i spawn i can get asin and acos but when i move(d) i cant get these...
and the atan is working? myrot is 55 and the atan is 88.9583 and the tan ( in calculator ) is 1.42...
atan2 is working well

pls check these functions...
Kovacs_Richard is offline  
Old 17/11/2009, 07:55 AM   #2
Little Clucker
Join Date: Jan 1970
Posts: 10
Reputation: 47
Default Re: asin. acos, atan, atan2

atan(55) = ~88.96 degrees, that's correct. I don't see the problem.
Mike is offline  

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
asin, acos, atan, atan2 funcs? xomka Help Archive 1 28/10/2009 08:35 AM

All times are GMT. The time now is 03:49 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.