0
$\begingroup$

Hi everyone thanks for taking your time to help!

I am developing a game where planets are orbiting (always a perfect circle) and ships move between the planets. I need to be able to find what angle to launch a ship at so that it meets up with the moving planet? There is no gravity or anything of that sort. I am simply trying to determine what angle to launch a linearly moving object at with a constant speed in order to meet a circular moving object with a constant speed?

So in summary I have the following pieces of information:

-Planet A (origin) x,y coordinates at time of launch

-Planet B (destination) x,y coordinates at time of launch

-Planet B (destination) orbit / movement speed (constant)

-Spaceships's movement speed (constant)

I need to know:

-What angle to launch the ship at in order to meet Planet B while moving the ship in a straight line.

Thanks so much again!!

PICTURE - How to determine ship's launch angle?

$\endgroup$
  • $\begingroup$ Show us which parts of the calculations you have a problem with. $\endgroup$ – Hidde May 30 '17 at 18:32
  • $\begingroup$ Sorry, all of it, I don't even know where to begin with it. I have x,y coords of both planets and the velocity of the ship, and the circular velocity of the destination planet. I am trying to find a calculation that can give me a vector or angle that the ship would have to leave the origin planet at to reach the destination planet in a straight line at it's given velocity. The best solution I could think of currently would be to guess at an angle, run a simulation to test it and adjust that until I hit the target, but this would take tons of calculations and slow things down a bunch. $\endgroup$ – MT Worlds May 30 '17 at 18:42
  • $\begingroup$ Related to math.stackexchange.com/q/344877/265466. $\endgroup$ – amd May 30 '17 at 19:11
  • $\begingroup$ One way to get started is to compute the intersection of the rocket’s path with the target orbit as a function of the launch angle. That will let you compute the intercept time as a function of the angle, and then, in theory, you can find the angle at which the target planet is also at the intersection point at that time. $\endgroup$ – amd May 30 '17 at 19:22
  • $\begingroup$ Thanks for the related question amd, that is the exact same question, doesn't look like he found an answer either. Hopefully someone can help. I will message that user also to see if he solved it, if he did I will post the solution here. Unfortunately your 2nd post doesn't help much in this situation since I do not know the rocket's path as I need to determine which direction to send it in. $\endgroup$ – MT Worlds May 30 '17 at 19:53
0
$\begingroup$

Craig Johnston responded saying that he could not find a solution to his request either, but he used this method and was able to make something out of it. gamedev.stackexchange.com/a/75037 Indeed this helped us get in the right direction also.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.