An explanation of 2D collision tests in CoffeeScript