Today with the rapid development of the information age, the exchange of science and technology has brought closer the closeness of countries, and our country has also begun to conduct in-depth research on WSN. This research mainly discusses the computer simulation algorithm of gymnastics formation change path based on wireless sensor. In this research, an improved Leader-Follower method is designed. In the research of gymnastics formation transformation of mobile nodes in the wireless sensor network environment, the traditional three types of nodes are divided into four categories according to the different formation responsibilities, namely, coordinator, beacon node, master mobile node (Leader), slave mobile node (Follower). After it accurately locates itself with the help of the information of the beacon node, the information should be sent out in the form of broadcast, and the coordinator sends the information to the host computer through the serial port for tracking display. In order to enable the mobile nodes in the network to keep the current gymnastic formation moving toward the target point after completing the gymnastic formation transformation, this paper uses the l-φ closed-loop control method to modify the gymnastic formation in real time. The method based on the received signal strength is selected to realize the positioning of the beacon node to the mobile node, and combined with the positioning engine in the core processor CC2431 of the mobile node, efficient and low-energy wireless positioning can be realized. Multiple mobile nodes coordinate with each other to control communication between each node in a wireless manner, and sense their own heading angle information through geomagnetic sensors, so as to make judgments and adjustments on the maintenance and transformation of the current gymnastics formation. During the formation change, after analysis, it is concluded that the maximum offset of Follower2 from the ideal path in the process of traveling to the desired position in the triangular queue is + 0.28 m. This research effectively realized the computer simulation of autonomous formation.