Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Mathematics questions deal with the arithmetic, geometry, calculus, formulae and other calculations used in the development of a game.
99
votes
Accepted
What are atan and atan2 used for in games?
The tangent formula is this:
tan(angle) = opposite/adjacent
Refer to this drawing:
Where a is the adjacent side, o is the opposite side and theta is the angle. Similarly, sine and cosine are sin( …
3
votes
Calculating and detecting curves
For the curve or straight line problem, I think I'd keep a list of the positions of old input. Then, I'd check the slope between every point (delta Y / delta X). If the slope does not change a lot, th …
8
votes
Accepted
Angle of Reflection
I'm not sure if I understood your problem correctly, but I assumed that what you want to do is find the resultant direction of you ball after a collision.
Here's a quick drawing on my white board tha …