Javascript math utility for games.