NASA has crashed a spacecraft into an asteroid 7 million miles away in the hopes of studying any alterations to its trajectory.