Time-varying formation tracking for second-order multi-agent systems subjected to switching topologies with application to quadrotor formation flying