A least-squares minimization approach to shape determination from gravity data