Note: The code to reproduce the results can be found on the sPYnning Github repository.

Spinning globe

The source code to animate a spinning globe is published on Github. The sphere is approximated by hexagons (and few pentagons). By assigning a color to each hexagon, we can color-code the globe to represent the ocean / landmass of the earth, or even different countries.


We can fake a diffusion equation on the sphere by simply updating a cell's value based upon the neighboring cells. For a full diffusion equation, the areas of the cells would need to be included. For this animation, I did not consider this yet. Since I could not get my hands on an elevation profile, I only distinguish between landmass an ocean and run the diffusion equation on these values.

The update rule then looks like this.

This update need to be applied in every iteration, resulting in the following code (including plotting).

This results in the following animation (or versions of it).

Game of Life

It is easy to implement a spherical Game of Life version. However, it is hard to find appropriate update rules. The idea is, that the (boolean) state of a cell is being updated based upon the states of the neighbors. If the neighbors are alive, they bring life to the cell. If too many neighbors are alive, a cell dies. A possible implementation can look like this. Here you can be creative.

We can initialize the states randomly as True or False. Some fine-tuning is required to find a good update rule.