|
|
|
|
|
by sillysaurus2
4666 days ago
|
|
Almost any kind of rotation in 2D or 3D graphics involves cos or sin. The spinning was going the wrong way, therefore the way to reverse it was to reverse something involving cos or sin. You can then just bruteforce it by reversing each cos until you get the effect you want. (If reversing cos seems to reverse something "perpendicular" to what you want, then you'd need to reverse the sin instead, not the cos.) This is true in almost any context involving 2D/3D graphics, not just for this particular example. It's much more efficient than trying to sit there and think through the math or figure out what does what. But of course you learn less that way, so it's a tradeoff. And sometimes it's less efficient if there are too many combinations to efficiently bruteforce, or if it takes too long to test each iteration. But we live in the age of rapid-iteration javascript. |
|
(I still remember how people would describe trig in high school, it is a wonder more teachers didn't explain the cos = x, sin = y thing. Probably because my teachers did not understand math.)