Sure, I knew that I would need to know how long it would take to fill up a pool with a 1/2 inch garden hose if the 1 inch drain was open. And of course, how long it would take to meet and where we would end up if we were traveling toward each other at different speeds. Sure, practical, but all that other stuff like slope and cosine and square roots and tangents.
Well, I've recently been working quite a bit more with Macromedia Flash in creating games and toys, and I'm actually using algebra.
I'll give you an example:
I've got a ball (actually, it's a circle) in a box that you can drag and "throw". Well, I need to tell the ball that it can't go any further than the boundaries of the box, but the centerpoint of the "ball" is what holds all the information. So, I have to tell the ball that the centerpoint plus the radius of the circle is what collides with the boundary. Otherwise, half the circle will go past the boundary before the centerpoint hits the wall and bounces, which would look strange.
So, basically, I tell the ball(it's diameter is 100): if ball(x=x+50/y=y+50) hits the boundary, then go the opposite direction.
This is not the actual code, but I was trying to explain it in a way I would understand it.
The next part uses cosine to calculate the angle which the ball came and hit the boundary, so when it bounces off, it looks like the correct direction. It has something to do with a triangle.
I sure wish I had paid more attention.


