Given the names of two planets, give the distance Using the following table (source) write some code that takes the names of two planets and returns the distance between them:

+-------------------+---------------+
|      Planets      | Distance (km) |
+-------------------+---------------+
| Mercury -&gt; Venus  |      50290000 |
| Venus -&gt; Earth    |      41400000 |
| Earth -&gt; Mars     |      78340000 |
| Mars -&gt; Jupiter   |     550390000 |
| Jupiter -&gt; Saturn |     646270000 |
| Saturn -&gt; Uranus  |    1448950000 |
| Uranus -&gt; Neptune |    1627450000 |
| Neptune -&gt; Pluto  |    1405380000 |
+-------------------+---------------+


Examples, input then output:

Mercury, Mars
170030000




Neptune, Jupiter
-3722670000




Earth, Earth
0


Note the negative sign there, as Jupiter comes before Neptune. They are also all integers.

Pluto doesn't have to be included (mostly because of a weird orbit which makes it hard to work out the distance - that distance given is my own calculation, but as Pluto is all famous now...).

By distances between planets I'm meaning orbits - I don't expect a date and working out where they are.

This is code golf, shortest code wins.
CJam, 54 51 44 bytes

2{"X84VT:Z/3KD'Y-&gt;&gt;6\ Ta "3/r26b93%=70be4}*-


Try it online in the CJam interpreter.

Idea

We use a simple hashing function to identify all eight planets. By considering each name as the array of its code points, converting them from base 26 to integer and taking the result modulo 93 then modulo 8, Mercury, Venus, Earth, etc. map to 2, 4, 0, 1, 3, 5, 6 and 7.

Now, we choose a point that lies 320,000 km behind Neptune and calculate the distances of all eight planets to that point. After dropping four trailing zeroes and reordering the planets so that they fit the 8 indexes from above, we obtain the array

[435172 427338 444341 372299 439312 307672 162777 32]


which, if we encode each integer in base 70, yields the following:

[
   [1 18 56 52] [1 17 14 58] [1 20 47 51] [1 5 68 39]
   [1 19 45 62] [  62 55 22] [  33 15 27] [       32]
]


Remembering that two adjacent digits (A B) can be replaced with ((A-1) (B+70)), we can modify the array from above so that all integers can be encoded as printable ASCII characters:

["X84" "VT:" "Z/3" "KD'" "Y-&gt;" "&gt;6\\" " Ta" " "]


Code

2{                         e# Do twice:   
  "X84VT:Z/3KD'Y-&gt;&gt;6\ Ta " e#   Push that string.
  3/                       e#   Chop it into chunks of length 3.
  r                        e#   Read a token from STDIN.
  26b                      e#   Convert from base 26 to integer.
  93%                      e#   Take the result modulo 93.
  =                        e#   Retrieve the chunk at that index.
  70b                      e#   Convert from base 70 to integer.
  e4                       e#   Multiply by 10,000.
}*                         e#
-                          e# Subtract the two results.