# Creating an Earth

A while ago I decided I wanted to create something that looks like the surface of a planet, complete with continents & oceans and all. Since I’ve only been on a small handful of planets, I decided that I’d approximate this by creating something like the Earth on the computer (without cheating and just copying the real Earth). Where should I start? Well, let’s see what the facts we know about the Earth tell us about how to create a new planet on the computer.

**Observation 1**:
Looking at a map of the Earth, we only see the heights of the surface.
So let’s describe just the heights of the Earth’s surface.

**Observation 2**:
The Earth is a sphere. So (wait for it) we need to describe the
height on a spherical surface. Now we can recast our problem of making
an Earth more precisely mathematically. We want to know the heights of
the planet’s surface at each point on the Earth. So we’re looking for
field (the height of the planet) defined on the surface of a sphere (the
different spots on the planet). Just like a function on the real line
can be expanded in terms of its Fourier components, almost any function
on the surface of a sphere can be expanded as a sum of spherical
harmonics

If we figure out what the coefficients

**Observation 3**:
I don’t know every detail of the Earth’s surface, whose history
is impossibly complicated. I’ll capture
this lack-of-knowledge by describing the surface of our imaginary planet
as some sort of random variable. Equation (1) suggests that we can do
this by making the coefficients ^{[1]}
I decided I’d use a Gaussian
random variable with mean 0 and standard deviation

(Here I’m using the notation that

**Observation 4**:
The heights of the surface of the
Earth are more-or-less independent of their position on the Earth. In
keeping with this, I’ll try to use coefficients ^{[2]}. Just for convenience,
we’ll pick this constant to be

At this point I got bored & decided to see what a
planet would look like if we didn’t know what value of

As the movie starts (^{[3]} As the movie continues and

**Observation 5**:
The elevation of the Earth’s
surface exists everywhere on Earth (duh). So we’re going to need our sum
to exist. How the hell are we going to sum that series though! Not only
is it random, but it also depends on where we are on the planet! Rather
than try to evaluate that sum everywhere on the sphere, I decided that
it would be easiest to evaluate the sum at the “North Pole” at

That doesn’t look too helpful — we’ve just picked up
another special function

Now we just have, from every equation we’ve written down:

So for the surface of our imaginary planet to exist, we had better have that sum
converge, or

As you can see from the movie, the distributions look like Gaussians. The fits from Eq. (4) are overlaid in black dotted lines. (Since I can’t sum an infinite number of spherical harmonics with a computer, I’ve plotted the fit I’d expect from just the terms I’ve summed.) As you can see, they are all close to Gaussians. Not bad. Let’s see what else we can get.

**Observation 6**:
According to some famous people, the Earth’s surface is
probably a fractal
whose coastlines are non-differentiable.
This means that we want a value of

which converges for

**Observation 7**:
70% of the Earth’s surface is under water. On Earth, we can think of the points
underwater as all those points below a certain threshold height. So
let’s threshold the heights on our sphere. If we want 70% of our
generated planet’s surface to be under water, Eq (4) and the
cumulative distribution function
of a
Gaussian distribution
tells us that we want to pick a critical height

where

_{
Top to bottom: p=0, p=1, and p=2. I’ve colored all the “water” (positions with heights < $H$ as given in Eq. (5) ) blue and all the land (heights > $H$) green.
}

You can see that the the total amount of land area is roughly constant
among the three images, but we haven’t fixed how it’s distributed.
Looking at the map above for

**Observation 8**:
The Earth has 7 continents This one is more vague than the others, but I think it’s the
coolest of all the arguments. How do we compare our generated planets to
the Earth? The Earth has 7 continents that comprise 4 different
contiguous landmasses. In order, these are 1) Europe-Asia-Africa, 2)
North- and South- America, 3) Antartica, and 4) Australia, with a 5th
Greenland barely missing out. In terms of fractions of the Earth’s
surface, Google tells us that Australia covers 0.15% of the Earth’s
total surface area, and Greenland covers 0.04%. So let’s define a
“continent” as any contiguous landmass that accounts for more than 0.1%
of the planet’s total area. Then we can ask: What value of *p* gives us
a planet with 4 continents? I have no idea how to calculate exactly what
that number would be from our model, but I can certainly measure it from
the simulated results. I went ahead and counted the number of continents
in the generated planets.

The results are plotted above. The solid red line is the median values
of the number of continents, as measured over 400 distinct worlds at 40
different values of ^{[4]}

**Notes**

1. ^ Since I wanted a random surface, I wanted to make the mean of each coefficient 0. Otherwise we’d get a deterministic part of our surface heights. I picked a distribution that’s symmetric about 0 because on Earth the bottom of the oceans seem roughly similar in terms of changes in elevation. I wanted to pick a stable distribution & independent coefficients because it makes the sums that come up easier to evalutate. Finally, I picked a Gaussian, as opposed to another stable distribution like a Lorentzian, because the tallest points on Earth are finite, and I wanted the variance of the planet’s height to be defined.

2. ^ We could make this rigorous by showing that a rotated spherical
harmonic is orthogonal to other spherical harmonics of a different
degree

3. ^ Actually

4. ^ For those of you keeping score at home, it took me more than 6 days to figure out how to make these planets.

Tweet
## Comments !