Hacker News new | past | comments | ask | show | jobs | submit login
Distance to Mars (johndcook.com)
70 points by bumbledraven on Oct 26, 2015 | hide | past | favorite | 40 comments



If you go a bit further, you can build surprisingly interesting curves from this math. Try calculating Mars' apparent motion, as observed on earth (i.e., projecting the difference of their positions onto a unit sphere). Its path is a loopy [0] curve, and looks like this:

https://imgur.com/a/I43kG

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


I made an app quite a while ago that lets you explore apparent motions, distances and more in 3D:

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


Brian Cox did a simple demonstration of why this was using some stones (link below). It makes a nice bit of sense but it must have messed with early astronomers heads when it was first observed

https://www.youtube.com/watch?v=kbynKfNfHk4


It certainly did mess with early astronomers. They were also hindered by their supposition that orbits are circles:

http://c2.com/cgi/wiki?AddingEpicycles


Cool! This could be taken a step further, adding in the oscillation of the moons rotation for slingshot and accounting for the travel time between earth-moon-mars to come up with a good list of launch dates. I'm sure there are other factors, I'm not a rocket scientist.


From Wiki[1] the aphelion and perihelion for Mars are 1.381 and 1.666 so I think assuming that Mars orbit is circular is just wrong. The eccentricity is 9%. The inclination of Mar's orbit is also 1.8 degrees which makes a difference as well.

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...


The results in the blog post wouldn't do to launch a probe, but they do give you a good idea of how the distance varies over time. It's a little surprising that such a simple calculation works as well as it does. More accurate calculations would be interesting, much more complicated.


The interesting thing here is that he used only algebra. This model therefore occupies a sort of sweet spot, insofar as adding to the accuracy of the model requires machinery a level above what was used to get this model.

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...


Looks at the graph on here: http://www.wolframalpha.com/input/?i=distance+from+earth+to+... (expand the time period to +/- 10 years)

It's wonderful.


This computes the exact distances of Earth to any planet in the solar system

apt-get install aa https://packages.debian.org/source/sid/astronomical-almanac


Thanks! The current distance is 2.24AU and it's decreasing (2.192 AU in one week).


Whoa! I didn't know of the Python syntax for complex numbers (1j). I was confusing the number 1 with lower case l and wondering where the "lj" symbol is coming from. Apparently you also need to use exp() from scipy, Python's standard math.exp() can't handle complex numbers (at least in python2).

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.


Note: 1AU = 149597870700m. It takes light around 8m20s to travel that distance.


500 seconds is a sightly easier way to remember the time.


So earth and mars are circling the sun in the same direction, anticlockwise.

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?


The most efficient way to get to Mars is nicely explained in Chapter 21 of "From Stargazers to Starships": http://www.phy6.org/stargaze/Smars1.htm

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.


very helpful link thanks


> 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.


Hi, some time ago I mentioned space simulator, if you are still interested I just added it to chrome web store as app, it is unlisted but you can find it here: https://chrome.google.com/webstore/detail/callisto-space-sim...


so does NASA time it's launches to when it get's to 0.5 AU? you'd think we'd have expeditions to mars every 2 years by now.


Its never a direct ballistic route - its a dance of orbital slingshots. You launch from here, so when you get over there, that's where Mars is. And sometimes you do a carom off Venus or whatever, to add some energy that you couldn't afford to get by rocket fuel.

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.


Slingshots have never been used for Earth-Mars launches where Mars is the final destination. I am having trouble finding a reference as to whether a Venus flyby could even reduce the energy budget for a Mars mission, but in practice no one has ever decided to do that.


Earth-Venus-Jupiter has been proposed; I assumed that Earth-Venus-Mars would have some benefit. I stand corrected.


I think some Mars missions have used a Moon slingshot to Mars, but I've never heard of Venus.


It does time the launches for short cruise time and lower energy required, but since the cruise time is significant that doesn't work out to launching at the moment of closest approach. See https://en.wikipedia.org/wiki/Human_mission_to_Mars section "Travel to Mars" for some discussion.


I'd love a section of my i3 statusbar showing the current distance in light seconds, at all times.

I'm surprised this isn't a thing yet.


Use "aa" from the astronomical-almanac package to calculate the value, then feed it into i3status.

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'


Much appreciated. Didn't know about aa.


It will be after first Mars colony gets set up and people will start Skyping between Mars and Earth.


With a minimum distance of 4 lightminutes you can wait 8 minutes (at a minimum) for a live answer... unless you time delay your mind with psychotropic substances, we engineer microscopic wormhole tunneling or we discover telepathy (IF telepathy goes faster then lightspeed) there will never be a live chat between mars and earth.


Seems very standard IRC channel; I look at IRC once in a while and write a bunch of replies.

This wouldn't change so much, although I'd need some sort of bouncer on earth in order not to ping timeout.


I like the delay-your-mind idea.


Perhaps we can use quantum entanglement.


No.


Why not? This appears to be researched still so I don't think there is a consensus that it isn't possible.


Everything we know so far tells us that you can't transmit information faster than light using quantum entanglement.


currently around 1117.8 seconds (18m 38s). in the tmux bar i've got the local solar elevation and azimuth angle as an alternative for 24 time.


Nasa has an open source tool for this that handles light time. http://naif.jpl.nasa.gov/naif/toolkit.html

Sadly, language options are c, FORTRAN, or poorly maintained MATLAB.


> Sadly, language options are c, FORTRAN, or poorly maintained MATLAB.

It's sad that that makes you sad.


There is also the HORIZONS tool which has a web interface: http://ssd.jpl.nasa.gov/?horizons




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: