21 ms·
You're right, I did state it a little awkwardly, but the statements are correct. I'll give a more concrete example: I'm firing a projectile at 52 degrees and
by Patrick_Devine 13y ago
You're right, I did state it a little awkwardly, but the statements are correct. I'll give a more concrete example:
I'm firing a projectile at 52 degrees and it needs to move 10 units. I'm at (5,7), where does the projectile end up?
delta x = cos(theta) * 10
delta y = sin(theta) * 10
So my final position is (5 + 6.16, 7 + 7.88), or (11, 15).
If I already knew how far the delta X and delta Y were, I could get the length of the hypotenuse with sqrt(6.16^2 + 7.88^2). That equals roughly 10, of course. If you want to try this out yourself, just remember that most trig functions are done in radians, so convert theta to radians with pi * theta (degrees) / 180.
- dllthomas 13y agoYes, I certainly wasn't disagreeing that trig is useful for games. The "if you want to try this out yourself" comes across a little patronizing in this context...
- Patrick_Devine 13y agoIt was more trying to be helpful. A lot of people's heads explode when they see trig, and they stumble on things like radians vs degrees. You can do some really cool stuff with just a little bit of knowledge.
- dllthomas 13y agoYeah, I don't get why more people don't get trig - it's always come very naturally to me, but I have to work to recognize that's not the case for everyone, particularly when confronted with experiences from my past like working on homework with math majors and finding them confused when I applied a trig identity to the problem...