This paper develops an algorithm to make simulation of an orbit transfer from Earth to Mars with different transfer angles, and strikes the best tradeoff between time and energy by analyzing different transfer scenarios. This algorithm is modified from Lambert theorem based transfer method, and is based on a four-body (Sun, Earth, Mars and spacecraft) model, taking account of gravitational and solar pressure effects. The results show that the orbit transfer from Earth to Mars by using this modified Lambert theorem based transfer method can be achieved with different transfer angles, and show that the larger transfer angle leads to the better tradeoff between time and energy.