Why my calculations for the eccentric anomalies at the start and end of an interplanetery transfer seem to be off?

For a game, to determine an interplanetary transfer I have implemented the method from here. Using the data for their example problem, I get the result with the lowest $$\Delta v$$ which appears plausible, for a transfer from Earth to Mars.

Departing on 20/07/2020 Arriving on 25/01/2021
Transit duration: 189.27 days
Total deltaV: 7154.86 m/s^2


Several calculations later, I determine the semimajor axis $$a$$ of the transfer orbit and then determine an ellipse (for plotting the trajectory) having as first focus the position of the Sun $$(0,0,0)$$ in the simulation and as second focus $$f_2=-2a\vec{e}$$ where $$e$$ is the eccentricity vector

Successively, I calculate the Eccentric anomaly at the starting position and final position using the ellipse, and I get two angles, $$e_0$$ and $$e_1$$. I then plot the trajectory in my game and it only renders correctly if I make these corrections: $$e_0'=-e_0$$ $$e_1'=-e_1+2\pi$$

With $$e_0'$$ and $$e_1'$$ being the "correct" eccentric anomalies for the start and end of the transfer orbit. This transformation seems to hold true for every start date combination I have tested so far. If I don't apply this transformation, the trajectory starts and end in the wrong position (a bit "ahead" in time of where the starting planet is).

Two questions:

1. This seems to be the result of a coordinate mismatch somewhere. What kind of error could lead to this situation?
2. After reading a bit on the topic I thought that the interplanetary transfer was supposed to "span" $$180^\circ$$ from the start, however the values I'm getting with different start dates seem to vary. With the starting conditions above, the delta between $$e_1'$$ and $$e_0'$$ is $$~132^\circ$$. With other starting dates, it can be even higher than $$180^\circ$$, but the trajectories are all visually correct at least. The planet is always in the correct position at start and likewise for the final planet at arrival. Did I misunderstand something?
• This might be better asked in Space Exploration (as it is about a spacecraft, not a natural orbiter) 2 days ago
• I’m voting to close this question because definitely anything related to spacecraft astrodynamics and the Braeunig website is off-topic for Astronomy SE but likely on-topic in Space SE. I've accidentally posted Space and Astronomy questions in each others' SE sites myself, it's easy to do. You can delete here and repost there, or just click "Flag" and ask for moderator assistance to migrate the question to Space SE.
– uhoh
19 hours ago