SA-MP Forums Archive
Ask you the question of the anti trigonometric function - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Ask you the question of the anti trigonometric function (/showthread.php?tid=656792)



Ask you the question of the anti trigonometric function - Ezzz - 24.07.2018

I saw wiki, but I only found these trigonometric functions of floattan, floatcos, floatsin.
I want to make a script that can tell whether the player is facing a OBJ. I think I need an inverse trigonometric function to complete the operation.
But I didn't find the sentence of inverse trigonometric function, so I asked the forum you, please help me, thank you.


Re: Ask you the question of the anti trigonometric function - coool - 24.07.2018

Did you look into this? https://sampwiki.blast.hk/wiki/GetPlayerCameraTargetObject
EDIT:Inverse of something is usually '1/n' In this case:
PHP код:
floatcosec(Float:number)
{
    return 
1/floatsin(number);
}
//cotagent and secant like the above way. 



Re: Ask you the question of the anti trigonometric function - Freaksken - 24.07.2018

They're already defined in a_samp.inc, but just not documented on the wiki.
Код:
native Float:asin(Float:value);
native Float:acos(Float:value);
native Float:atan(Float:value);
native Float:atan2(Float:x, Float:y);



Re: Ask you the question of the anti trigonometric function - Ezzz - 27.11.2018

Quote:
Originally Posted by coool
Посмотреть сообщение
Did you look into this? https://sampwiki.blast.hk/wiki/GetPlayerCameraTargetObject
EDIT:Inverse of something is usually '1/n' In this case:
PHP код:
floatcosec(Float:number)
{
    return 
1/floatsin(number);
}
//cotagent and secant like the above way. 
omg im very thank you!!
xD