An algorithm was developed for the formation flight of a team of fixed-wing aircraft to follow a desired trajectory described in terms of given waypoints. In-flight formation change can be commanded at set points along the trajectory or on demand. The algorithm makes use of the Hungarian algorithm for formation position assignment in a local tangent coordinate system. Trajectories of the aircraft in the global coordinates are compactly represented by parametrized B-splines, which enabled trajectories to be easily passed between aircraft. A proportional-derivative (PD) controller was used to control the speed of the aircraft to maintain synchronous formation flight. The algorithm was successfully tested in both simulation and field experiments.