>>61184554Some fancy algorithms. At the simplest form: every X seconds it looks at its airspeed indicator and compass. It can use this to derive an average velocity vector over the last X seconds. New estimated position is the previous position plus velocity vector multiplied by X. It can do the same thing when getting a better estimate of the velocity, by measuring the acceleration vector. This part is simple algebra (acceleration integrates into velocity, which integrates into position). The position is ofc relative to the origin, the launch site, which assumably is known.
You can make something "kinda" accurate based on the above alone. Early missiles would just do something like that.
When the Americans landed on the moon they invented something called the kalman filter, which allowed for advanced "sensor fusion", revolutionizing this kind of shit. Sensor fusion is when you have a bunch of different, independent sensors and you combine them with advanced models and you combine them into a more accurate estimate. The model includes aerodynamics and of the rocket engine itself. Like, you know how much you've opened the fuel valve, you can calculate the thrust. Same thing for control surfaces.
With a kalman filter you also get a confidence interval (probability) of your estimate. This was essential to be able to land the lunar lander on the moon, softly.
Today you ofc have GPS, which can be fed into the kalman filter just like any other sensor, and it can give an extremely accurate estimate of where the missile is. You could even start use something like an AI interpretation of a camera image and use it as an input for your kalman filter. For a modern missile the control software gets really bloody complex.