GPS positioning actually determines the position of the GPS receiver through four known satellites.
As shown in the above figure, the GPS receiver in the figure is the current device to be located. Satellites 1, 2, 3, and 4 are the four satellites to be used for this positioning:
Position1, Position2, Position3, and Position4 are the current positions (spatial coordinates) of the four satellites, which are known
· d1, d2, d3, d4 are the distances of the four satellites to the GPS receiver to be located.
· Location is the location of the satellite receiver to be located, which are pending.
Then the positioning process, in simple terms is through a function GetLocation (), from the known [Position1, d1], [Position2, d2], [Position3, d3], [Position4, d4] four pairs of data to find Location The value of
Why need 4 pairs of parameters? Then let's explore it together.
In fact, each of the GPS satellites operating in space has broadcasted its own current position coordinate information to the world through satellite signals. Any GPS receiver can easily receive this information through the antenna, and can read this information (this is actually one of the core functions of each GPS chip). This is where these location information comes from.
We already know that every GPS satellite is broadcasting its own position, then sending the location information, it will also attach the timestamp when the packet was sent. After receiving the data packet, the GPS receiver uses the current time (of course, the current time can only be determined by the GPS receiver itself) minus the time on the time stamp, which is the time for the data packet to be transmitted in the air.
Knowing the transmission time of the data packet in the air, multiplying the transmission speed of the data packet is the distance that the data packet transmits in the air, that is, the distance from the satellite to the GPS receiver. The data packet is transmitted through radio waves. The ideal speed is the speed of light c. If the propagation time is recorded as Ti, the formula is expressed as:
This is the source of di(i=1,2,3,4).