Try now in the
Open Cloud »
(no sign-in required)

Age in Mars Years

Find out how old you are in Mars years or the years of other planets.

Run the code to find the orbit period of Mars. Try other planets, like Venus or Neptune:

SHOW/HIDE DETAILS

Use plain English to get an exact representation of the planet Mars. Type += and in the input box, type mars:

In[1]:=
X
Out[1]=

An exact representation gives you access to all sorts of information about the planetfor example, the period of its orbit (how long it takes to go once around the Sun, which is the length of one of the planets years).

A Mars year is 1.88 Earth years:

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Find out how many Earth days old you are. Try some other dates:

SHOW/HIDE DETAILS

Today gives todays date:

In[1]:=
X
Out[1]=

DateDifference gives the number of days between two dates.

This gives your age in days if your birthday is February 2, 2009:

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Find out how many Earth years old you are. Try some other dates:

SHOW/HIDE DETAILS

The length of time since your birth divided by the time it takes for the Earth to orbit the Sun is your age in Earth years:

In[1]:=
X

HIDE DETAILS
In[1]:=
X
Out[1]=

Find out how many Mars years old you are. Try some other planets:

SHOW/HIDE DETAILS

The length of time since your birth divided by the time it takes for Mars to orbit the Sun is your age in Mars years:

In[1]:=
X
Out[1]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Display your age in the years of the planets. Try other birthdays:

SHOW/HIDE DETAILS

You can make this expression easy to apply to any planet by turning it into a pure function:

In[1]:=
X
Out[1]=

To make a pure function, replace LinguisticAssistant with # and follow the expression with &:

In[2]:=
X
Out[2]=

You can use that expression to find an age in the years of any planet:

In[3]:=
X
Out[3]=

Find your age in the years of several planets by using Map (/@) to apply the function to a list of planets:

In[4]:=
X
Out[4]=

This gives you a list of all of the planets:

In[5]:=
X
Out[5]=

Find your age in the years of all of the planets:

In[6]:=
X
Out[6]=

Add the planet to the age:

In[7]:=
X
Out[7]=

Format the data as a grid:

In[8]:=
X
Out[8]=

Label the columns:

In[9]:=
X
Out[9]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Share ItMake a website that tells you your age in years of all the planets:

SHOW/HIDE DETAILS

Deploy the planetary age calculation to make a website where you can enter a birthdate and find out how old you are in years of all the planets. With[{date=#birthdate}, ...] is necessary so that it is clear that the #birthdate parameter belongs to the outer pure function (the one that CloudDeploy is acting on) and not the inner one (the one mapped over PlanetData[]):

In[1]:=
X
Out[1]=

Click the link in the output to visit the site.

Share the link by right-clicking it and choosing Copy Address. Paste the link into an email, tweet, or other message.

HIDE DETAILS
In[1]:=
X
Out[1]=