Text this: Distance estimating algorithm based on gradient neighbors in wireless sensor networks