The localization is an important technology for the sensor network. In this paper, we improved the large error of the Bonding-box algorithm in the case of the two anchor nodes and the disadvantages of the indistinguishable localization of coordinates. The algorithm is combined with the ranging technology RSSI, and is simple to be achieved without additional hardware equipment. It is found during the experiment that it has low accuracy of localization at the edge of sensor network on the situation with a small number of anchor nodes (mainly has two anchor nodes). And all the nodes in the range are located in the center of the range, which results in a low degree of identification. In this paper, we propose a new algorithm to reduce the error and improve the identifiable degree. MATLAB simulation is used to show that the algorithm is better than the Bonding-box algorithm which is based on the weighted centroid, and it can be applied to all of the current improved algorithms which are based on Bonding-box algorithm. And this algorithm could reduce the error of the improved algorithm.