Unmanned airborne vehicles (UAVs) are finding use in military operations and starting to find use in civilian operations. UAVs often fly in formation, meaning that the distances between individual pairs of UAVs stay fixed, and the formation of UAVs in a sense moves as a rigid entity. In order to maintain the shape of a formation, it is enough to maintain the distance between a certain number of the agent pairs; this will result in the distance between all pairs being constant. We describe how to characterize the choice of agent pairs to secure this shape-preserving property for a planar formation, and we describe decentralized control laws which will stably restore the shape of a formation when the distances between nominated agent pairs become unequal to their prescribed values. A mixture of graph theory, nonlinear systems theory and linear algebra is relevant. We also consider a particular practical problem of flying a group of three UAVs in an equilateral triangle, with the centre of mass following a nominated trajectory reflecting constraints on turning radius, and with a requirement that the speeds of the UAVs are constant, and nearly (but not necessarily exactly) equal.