Hi - Greenhorn alert! (That's ME, tossing in a few suggestions.)
You might check out this article "Painting in AWT and Swing":
http://java.sun.com/products/jfc/tsc/articles/painting/
Yes, i agree that the math looks fine but that sometimes you are getting extra ("bonus") repaints from the system, perhaps due to the mouse movement? If the extra repaints occur during your sleep time, perhaps it won't make a big effect on the animation?
I've been experimenting with using a Timer, using that to trigger updates and repaints. You might look at that as a way to handle the desired latency without having to put your code to sleep. I've been having some success there.
(Is it okay to show off an app?
http://www.adonax.com/Jean/HowWide -- this
Applet draws lines in XOR mode, up to one per 25 msec when the slider starts working -- the applet is in development, something a friend of mine is designing and I'm programming it for him. During the start when it gets crazy, the Timer is kicking out RemindTasks at the rate of one per 5 msec, but I strongly suspect the redraws are getting collapsed into less frequent events.)