SohCahToa and Pythagoras. Play on Turbo mode for better speed. There is still one bug, idk what it is yet. but I have encountered it. If you find a bug, pause the simulation, type in all the variables in the comments and their values. And I will try my best to recreate the bug so I can figure out how to fix it.
It works, just play it. It used Pythagoras to find the distance between the missile and the target, then uses SohCahToa to find the angle and does other calculations to find the difference and then decides whether to go right or left. I made this for my missile in Stormworks (another game on steam), for my verticle stabaliser. This will be turned into logic.