Wireless sensor networks more complex in the marine environment than in terrestrial environments, the independent positioning mechanism can reduce the difficulty of modeling. The study on underwater acoustic sensor network node distribution of two-dimensional and three-dimensional respectively and the establishment relation function of the distance of beacon nodes and unknown nodes which based on in the traditional centroid algorithm idea. Using Taylor series can reduce the complexity computing of nodes who sensitive to energy because of its linear approximation in a manner. Because the genetic algorithm fitness function only interested in building the corresponding function, optimizing the established function. Simulation results show that: it can achieve the nodes self-localization effectively both in two- dimension and three-dimension that the distance formulas between nodes are liberalized by Taylor series and optimized by genetic algorithms.