A Motion Planning Algorithm in a Figure Eight Track