collision detection algorithms and applications