A distributed gradient method for localization of formations using relative range measurements