Posts: 1,745
Threads: 252
Joined: Dec 2011
Reputation:
0
Hello, I've been learning trigonometry lately in my free time and noticed that its often used in programming (as well as in sa-mp). I was wondering, what can trigonometry be used for? and could you give me some examples of code to get my head through the concept.
Posts: 791
Threads: 65
Joined: Oct 2009
Reputation:
0
Get direction of Turrent gun to face and shoot player
do stuff with NPC (facing, running, etc..
Posts: 1,745
Threads: 252
Joined: Dec 2011
Reputation:
0
Sorry if this is a stupid question.. (Haven't been doing trig for long + only in my spare time (my maths teacher isn't teaching me it yet :c ) )
In the function "Floatsin" it takes an angle.. I thought in order to get the sin of something you need to know the size of the hypotenuse and the size of the opposite side.
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
I think that's sin-1. sin(angle) sin-1 (asin or arcsin or something) of the opp/hyp.
Posts: 1,745
Threads: 252
Joined: Dec 2011
Reputation:
0
Okay thanks, I thini I pretty much get it now. The only thing I don't really get is how Floatsin works.
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
What do you mean 'how it works'?