Formation design and nonlinear control of spacecraft formation flying