I have written quite a bit of collision detection/resolution code and other physical simulation code. Basic rigidbody physics for games, cloth and rope simulations, spatial indexing for ray-tracing, etc.