implemening easy algorithms from computational geometry