Planning Motions for Robots, Crowds and Proteins