Ask you the question of the anti trigonometric function
#1

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.
Reply
#2

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. 
Reply
#3

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);
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)