I am in 12th grade, and for my math class we have to do an independent math exploration, and for mine I thought I would try to find the best position for a planet to be in a gravity assist.
So the problem is as follows:
(A) Suppose there are two planets, $A$ with mass $m_1$, and $B$ with mass $m_2$, in a 2D plane, at $(x_1, y_1)$ and $(x_2, y_2)$ respectively. A spacecraft with mass $m_s$ wants to get from planet $A$ to planet $B$, but does not have enough fuel to make the journey. If a third planet, $C$ with mass $m_3$, is introduced somewhere in between the two planets, what is the optimal position for it to be in such that the gravity assist maneuver takes the least amount of time?
I plan to solve the problem with numbers instead of x's and y's so that I can generalize my results to say something like "Planet $C$ should be at $(\frac{x}{2}, \frac{y}{2})$."
My problem is, I have no idea how to solve this problem. I tried looking up how to solve problems like this, and the closest thing I found was a basic example from MIT's 8.01 classical mechanics course.
To make it clear, the kind of problem I want to solve is:
(B) If planet $A (6 \times 10^{24} kg)$ and planet $B (1.2 \times 10^{30}kg)$ are at $(3,5)$ and $(324 \times 10^{6}, 890 \times 10^{6})$ respectively, and a spacecraft with mass $10^4 kg$ wants to travel from planet A to B, how long will it take to reach planet $B$ if planet $C$ is at $(200 \times 10^{6}, 300 \times 10^{6})$, and has a mass of $8 \times 10^{25}$??
If I can solve this problem, I will be able to generalize the problem and find the time taken for other coordinates as well.
I think that if I can learn how to do one scenario in this problem on my own, I will be able to automate the process, and design an algorithm that can test each coordinate between the two planets and find the optimal coordinate (I can code in Python, so that helps).
I'm asking for help in solving problem (B), and if possible, help with how I can generalize the results to solve problem (A).
If there is any missing data that you might need to solve problem (B), just make up something arbitrary to solve the problem. Thanks in advance for any help.