have you been to http://www.kirupa.com and browsed the tutorials? Or, have you checked the math and physics tutorials on FK? Or maybe I saw it somewhere here:

http://www.flashperfection.com/tutor...als-26531.html

Ahab's Math tuts are pretty rocking. I've done half of anything involving math with help from this site. I'll check around some more too and see if I can't find the exact one. I know I had a fla with the answer to your problem and I played with it for hours. I'll find it again.