Distance to Mars
johndcook.com
johndcook.com
Note that you don't need to implement elliptical orbits to see this effect -- circular inclined orbits can exhibit it.
[0] https://en.wikipedia.org/wiki/Apparent_retrograde_motion
http://gunn.co.nz/astrotour/?data=tours/retrograde.xml
(Keep clicking the next arrow at the bottom for a tour). Here's a mars from earth example - http://imgur.com/TeX1yRn
Wiki also lists a closest approach to Earth of 0.372 AU and a furthest distance of 2.675. The graphs on that link do not come close to those figures. They are off by 25%.
Basically I do not understand why someone would take an orbital problem, simplify all the interesting bits out of it and then put it up on a blog. Maybe he was more interested in the maths than the physics.
(1) - https://en.wikipedia.org/wiki/Orbit_of_Mars#Table_of_orbital...
It's wonderful.
To wit: If you want to take into account eccentricity (which I think would be the biggest source of error), the steps needed are fairly involved. For one way to do it, see [0].
[0] https://en.wikipedia.org/wiki/Kepler%27s_laws_of_planetary_m...
apt-get install aa https://packages.debian.org/source/sid/astronomical-almanac
The model in the blog post was obviously a simplified model. It assumes circular and coplanar trajectories, both of which are good approximations for back-of-a-napkin calculations such as this one but not super accurate for real life analysis.
In the hopes that there are some programmers interested in astrodynamics or celestial mechanics, I'll shamelessly take this opportunity to promote a related programming project of mine: https://github.com/rikusalminen/twobody
It's a simple C library that solves some fundamental problems in celestial mechanics, including state of the art solvers for time of flight (ie. solving Kepler's equation using the Laguerre-Conway method) and can work in 3D and with elliptic (and hyperbolic and parabolic) trajectories. It may seem a bit cryptic (I wish I had the time to write docs), but if you're familiar with the field, you should be able to understand most of it.
Earth has a shorter orbit and is also going nearly 25% faster.
If earth's at 12 o'clock, where is mars and what direction (N,S,E,W etc) do we aim a rocket for the shortest journey?
Mars would be about 45 degrees ahead of Earth, and we aim the rocket so that when it "exits Earth's gravity" (keyword: hyperbolic excess velocity), it will travel in a path that is parallel with Earth's orbit but faster, so the trajectory will be an ellipse with the highest point around Mars' orbit. When the space craft arrives at Mars many months later, both planets have travelled a significant distance.
You are asking for the "shortest journey" however. Well, the shortest journey would be to accelerate to the speed of light when they are pretty much closest to each other and arrive a couple of minutes later. Not very feasible as of 2015.
So no, the fact that Mars is sometimes very close to the Earth is not really helpful. What'd be helpful is, if the max distance were not so great. But we're stuck with what nature gave us.
It can help to try Kerbal Space Program, to get a feel for orbital mechanics. In fact, it may be the best way to get that feel.
I'm surprised this isn't a thing yet.
This wouldn't change so much, although I'd need some sort of bouncer on earth in order not to ping timeout.
Here's the current distance to Mars in AU:
date +"%Y%n%m%n%d%n%H%n%M%n%S%n1%n1%n4" |\
aa|\
sed -n '/distance/s/.*\([0-9]\.[0-9]* au\).*/\1/p'
And here it is in light minutes (useful for Skype!) date +"%Y%n%m%n%d%n%H%n%M%n%S%n1%n1%n4" |\
aa |\
sed -n '/light time/s/,.*//p'Sadly, language options are c, FORTRAN, or poorly maintained MATLAB.
It's sad that that makes you sad.