geometry helpers to measure distance between two points
check for collision between a moving rect and a rect