If for some reason you are engaged in computational intensity in javascript, you should remember these things (* and read David Mandelin Know your engines: how to make your JavaScript Quick presentation - PDF , where he describes it in more detail *):
, distance(), Math.method() .
sqrt, , , x*x, random , Pi , , min max .
PS: - ((x >= 0 ? x : -x) + 0.5) >> 0, Math.ceil(Math.abs()), - "" - , , , . JavaScript RIA - , . ,