Abstract:The location information of the sensor node is one of the key technologies in Wireless sensor network(WSN). To improve the location accuracy, a geometric localization algorithmis proposed for wireless sensor networks. Nodes in the network area is divided into anchor nodes and unknown nodes, using the method of slope geometry, select the appropriate anchor node, to determine the location of unknown nodes more accurately. This paper proposed the least square error method based on the trilateration to improve the algorithm accuracy. A Matlab simulation model based on the new algorithm is established. The results show that the proposed algorithm improves node location accuracy a lot with same amount of anchor nodes under same radio range condition.