As children when we studied the solar system, something of this sort got engraved in our minds.
In real, the planets are orbiting the sun at all times, so they are rarely ever aligned like that. If that is so, how do we aim rockets at other planets and know for sure that they reached where they were supposed to land?
The Earth is orbiting the Sun; the destination planet is also orbiting the Sun, and so is the spacecraft. Of all these, we can only manipulate the curved path of the spacecraft by firing thrusters. Moving the shuttle from one location to another requires changing its orbit so that it intersects the target orbit.
All orbits are elliptical; the point closest to the orbited body is called periapsis, and the point farthest to it is called the apoapsis. The minimum energy for transfer of orbit is used to minimize the amount of fuel required. A Hohmann transfer orbit is employed for this purpose that uses a burn at periapsis which increases the apoapsis of the orbit. The apoapsis needs to be far enough so that it occurs at the orbit of the aimed planet (let’s say, Mars). This intersection occurs 180 degrees later in orbit.
Now that the orbit is manipulated to cross the orbit of Mars, we need to know the exact time the spacecraft gets there so that Mars is present at that point in the orbit. The orbit of Mars is larger than that of Earth. More time is required to move the same angular distance for Mars as compared to Earth. The spacecraft should be launched at such a time that Mars is ahead of Earth.
The period of the shuttle orbit is calculated to be nearly 520 days. To move 180 degrees, we need to move half the orbit making the trip to be about 260 days. Mars has an orbital period of 687 days. In 260 days, Mars will travel an angular distance of 136 degrees. That shows the optimal time to launch the spacecraft is when Mars is 44 degrees (180-136) ahead of Earth in its orbit. Thus, we can initiate the craft about three months before Mars and Earth are at their closest.
So the launch of a rocket into space is planned considering the time, location and orbiting speed of Earth, the target planet, and the spacecraft.
Do you have something to add to the above information? Comment below!