PDA

View Full Version : Ask you the question of the anti trigonometric function


Ezzz
24/07/2018, 07:34 AM
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.

coool
24/07/2018, 09:06 AM
Did you look into this? http://wiki.sa-mp.com/wiki/GetPlayerCameraTargetObject
EDIT:Inverse of something is usually '1/n' In this case: floatcosec(Float:number)
{
return 1/floatsin(number);
}
//cotagent and secant like the above way.

Freaksken
24/07/2018, 06:10 PM
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);

Ezzz
27/11/2018, 05:39 AM
Did you look into this? http://wiki.sa-mp.com/wiki/GetPlayerCameraTargetObject
EDIT:Inverse of something is usually '1/n' In this case: floatcosec(Float:number)
{
return 1/floatsin(number);
}
//cotagent and secant like the above way.

omg im very thank you!!
xD