David Tran wrote:

>      degrees += 360.0 while degrees < 0.0
>      degrees -= 360.0 while degrees >= 360.0

These two lines can be replaced with:

degrees %= 360

And the resulting method will run much faster if the degrees argument is
large.

-- 
Paul Lutus
http://www.arachnoid.com