Hacker News new | ask | show | jobs
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.

1 comments

I'd also note that in a point on the unit circle, cosine is the x coordinate and sine is the y coordinate. A good reason to try flipping a cosine first. See this: http://en.wikipedia.org/wiki/File:Unit_circle.svg

(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.)

My teachers did explain it that way. European school, if that matters.
My experience with math education in the US is that they approach it as unapproachable. It is supposed to be some sort of magic, that only limited practitioners may understand, and even then only after an incredibly slow introduction. People teaching it are usually unqualified. Then if you're like me, when you get to college you get exposed to a lot better, then you wonder what those k-12 people were thinking. But a lot of people don't make it that far, because their earlier experience makes them think math is uninteresting or they'll never be any good at it.

Note that my experience involved going to a supposedly "good" school district. There is the entirely unrelated problem of schools varying in quality based on where you live.

European school, if that matters.

Heh. Yeah, that matters.

In my experience, US highschools are very much "Okay class, today we're going to memorize these formulas."

I don't think its that easy, it depends more on the specific school and most of all on the teacher. For the record: I also had to memorize it and i went to an "european" school, or rather to an austrian one. Europe still has a wide variety of education systems.
Same with the US. Very variable.

We went through the unit circle derivation in the 8th grade and were thus showed why cos is conventionally x and sin conventionally y.

and not all systems are uniform. I went to high school in Italy and changed something like 4math teachers.

One of them explained the x/y thing, another didn't.

Couldn't help reading 'ok glass we're going to memorize these formulas'. Ahh, the future.
My highschool teachers didn't (European school, too). I found it by myself one or two years later (I hated trig in the meantime) and was very proud of my achievement. Then I went to university where all the teachers were treating it like a natural thing, and that was my first glimpse of adulthood -- I started realizing I was really stupid.
Same here, but in Australia. Unit circles made trig "click" for me (and a whole heap of other concepts... a very versatile abstraction that one).