Wolfram Function Repository
Instantuse addon functions for the Wolfram Language
Function Repository Resource:
Computes the distance between astronomical entities
ResourceFunction["AstroDistance"][entity_{1},entity_{2}] Compute the distance between entity_{1} and entity_{2} for the current date and time. 

ResourceFunction["AstroDistance"][entity_{1},entity_{2},date] Compute the distance between entity_{1} and entity_{2} for the specified date. 

ResourceFunction["AstroDistance"][{entity_{1},…,entity_{n}}] Compute the distance between entity_{1} and entity_{n},through all the intermediate entity_{i}, for the current date and time. 

ResourceFunction["AstroDistance"][{entity_{1},…,entity_{n}},date] Compute the total distance from entity_{1} to entity_{n}, through all the intermediate entity_{i}, for the specified date. 
Compute the current distance between Mars and Jupiter:
In[1]:= 

Out[1]= 

Compute the distance between Mars and Jupiter on a specified date:
In[2]:= 

Out[2]= 

Compute the current total distance between entities:
In[3]:= 

Out[3]= 

Compute the total distance between entities on a specified date:
In[4]:= 

Out[4]= 

Entities can be in different domains:
In[5]:= 

Out[5]= 

In[6]:= 

Out[6]= 

Results are automatically given in appropriate units by default:
In[7]:= 

Out[7]= 

Target units can be specified:
In[8]:= 

Out[8]= 

Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License