Search

# Earth Venus cosmic dance – Animated chart in Excel

Share

Recently I saw an interesting Earth Venus cosmic dance video on Facebook. See the original video below or here.

Although this is not entirely accurate from physics & astronomy perspectives, the dance is a stunning example of patterns that are generated by simple things.

I wanted to recreate this cosmic dance in Excel. How else am I to get my spreadsheet fix on a Saturday?

### The details & assumptions

To create this cosmic dance, we need a few details

• Distance from Sun to Venus & Earth – 67.2 and 93 million KM respectively
• Number of days it takes to rotate around the sun – 224.7 and 365.25 respectively

We will also assume these incorrect things to keep our model simple

• Orbits of Earth & Venus are circular with Sun at center: In reality, they are elliptical, but as these are just stretched circles, we can assume circular orbits to keep the math simple.
• Sun is static: In reality, Sun (and entire solar system) is also moving. This means, this cosmic dance may never occur.

We also need one critical detail to graph this cosmic dance:

• The angular interval for plotting the lines. In the above examples, I have used 10° (ie there will be 36 lines around the circle). This is denoted by named range in the model. You can adjust this in the output worksheet using a form control. Different values of yield different patterns (although most of them will be pentagonal).

### The math:

Generating planetary co-ordinates:

In a table, we will generate the positions (X & Y co-ordinates) of both Venus & Earth for 3000 points in time, each incremented by degrees, starting at 0°.

To generate the X & Y values, we will use the x=r.cos? and y=r.sin? equations (where r is the distance from Sun and ? is the angle).

Drawing the lines:

This is the tricky part. At each step in the animation our line should from one tooth of the saw tooth pattern. See this demo to understand.

So during each step of the animation, we add more co-ordinates to the chart (scatter plot) to generate this saw tooth pattern. Over time, this will yield the beautiful pentagonal cosmic dance.

We can generate these successive Venus & Earth co-ordinates from the calculations performed earlier by using MOD & INDEX formulas.

Once such saw tooth line data is generated, we will designate a cell to hold current animation position. Let’s call this pos.

We will then create two named formulas – dance.x and dance.y. These will contain the data necessary for our scatter plot. We will use OFFSET formula to generate these dynamic named formulas.

### The chart

Now that all the necessary calculations are done, create a scatter plot with the dance co-ordinates. Set up X & Y axis minimum and maximum values accordingly (-160 to 160 should do). This ensures that the chart remains same no matter what step of animation we are on.

Also, add 3 more series to the chart

• One for a dot to represent Venus at current position
• One for a dot to represent Earth at current position
• One for a line connecting Venus to Earth

### The animation

Next, let’s add a small macro to animate the chart. This macro will increment pos from 1 to a large number. After each iteration, we will call DoEvents so Excel can re-draw the chart. That is all.

### Did you enjoy the dance?

I really liked the original video on FB and that is why I recreated this in Excel. This is a great exercise to show the power of simple things generating extraordinary patterns.

What about you? Do you like this Earth Venus dance?

### More Excel animation and fun:

If you like animating things, you are going to love these tutorials. Check out,

### Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

### Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

### Automatically Format Numbers in Thousands, Millions, Billions in Excel [2 Techniques]

Ever wanted to automatically format values in thousands, millions or billions in Excel? In this article, let me show you two powerful techniques to do just that.

## Related Tips

Charts and Graphs

Excel Howtos

### Get all BOLD text out Excel Cells Automatically

Charts and Graphs

### Make an Impressive Interactive Map Chart in Excel

Charts and Graphs

### How to Create a Dynamic Excel Dashboard in Just 5 Steps

Charts and Graphs

### How to create a fully interactive Project Dashboard with Excel – Tutorial

Charts and Graphs

### 4 Responses to “Earth Venus cosmic dance – Animated chart in Excel”

1. Michelle says:

Wow, I am in shock. Chandoo, you will never cease to amaze me. My goal in life is to be an Excel wizard just like you.

• ahmed says:

Can anyone help me for vba script for the following chart
Values Values
TYPE MAIN Description DECODE AB CD
F 10 Sports team 10000 1
F 60 public spectators 12500 <50
F 250 unmatched description 10000 1
M 10 Sports team 10500 200
M 250 unmatched description 10500 <50
M 90 Misc 10000 1
I 20 Non swimmers 11000 1
I 250 unmatched description 12500 2 00

Inputs are "Type", "Values" and "description"

Outputs values are "Main" & "Decode"

unmatched description has fixed result

Dear Chandoo

Can u pl share how to rotate a 3D earth in excel like Google earth

### Get FREE Excel & Power-BI Newsletter

One email per week with Excel and Power BI goodness. Join 100,000+ others and get it free.