miscellaneous mathematical and physics routines for game programming, c++ version