asin. acos, atan, atan2
#1

Код:
if(strcmp(cmd, "/position", true) == 0 || strcmp(cmd, "/pos", true) == 0)
	{
	  new Float:px,Float:py,Float:pz,Float:pa,pi,pw;
	  GetPlayerPos(playerid,px,py,pz);
	  GetPlayerFacingAngle(playerid,pa);
	  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);
      SendClientMessage(playerid,COLOR_YELLOW,string);
			format(string, sizeof(string), "TG-: %.4f | TG: %.4f", atan(360-pa),atan(pa));
			SendClientMessage(playerid,COLOR_YELLOW,string);

		}
		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);
      SendClientMessage(playerid,COLOR_YELLOW,string);
      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));
			SendClientMessage(playerid,COLOR_YELLOW,string);
		}
	  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...
Reply
#2

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


Forum Jump:


Users browsing this thread: 1 Guest(s)