ok, so I am making a computer game and i need some help working out an equation.
I think it is easiest to understand the problem if you think of a view of the solar system looking from 'above' (looking from an angle where the sun would be in the middle and you can see each of the planets orbiting it). Now imagine that we want to shoot a rocket from the Earth and hit one of the other planets with it. I need an equation which the AI can use to know which direction to shoot in to hit the target planet. The target planet could have a smaller orbit than the Earth or a larger one so the equation will need to work for both.
To make it easier, we only need to work in 2 dimensions, we are assuming that the planets are orbiting in perfectly concentric circles (not ellipses), the planets can be considered points in space and we can ignore gravity (the rocket moves at a constant speed in a straight line).
At any point in time, we know the position of the Earth and of the target planet (the radius of their orbits and at what point they each are in those orbits) and we know the speed the target is travelling and how fast the rocket will travel when shot.
So, can anyone help with an equation that will tell the AI which direction to shoot the rocket and an explanation so that I can understand it please?
I think it is easiest to understand the problem if you think of a view of the solar system looking from 'above' (looking from an angle where the sun would be in the middle and you can see each of the planets orbiting it). Now imagine that we want to shoot a rocket from the Earth and hit one of the other planets with it. I need an equation which the AI can use to know which direction to shoot in to hit the target planet. The target planet could have a smaller orbit than the Earth or a larger one so the equation will need to work for both.
To make it easier, we only need to work in 2 dimensions, we are assuming that the planets are orbiting in perfectly concentric circles (not ellipses), the planets can be considered points in space and we can ignore gravity (the rocket moves at a constant speed in a straight line).
At any point in time, we know the position of the Earth and of the target planet (the radius of their orbits and at what point they each are in those orbits) and we know the speed the target is travelling and how fast the rocket will travel when shot.
So, can anyone help with an equation that will tell the AI which direction to shoot the rocket and an explanation so that I can understand it please?