Earth Venus cosmic dance – Animated chart in Excel
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?
Here is a quick demo of the final outcome. Read on to learn more about the Earth Venus cosmic dance.
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 m in the model. You can adjust this in the output worksheet using a form control. Different values of m yield different patterns (although most of them will be pentagonal).
The math:
Generating planetary coordinates:
In a table, we will generate the positions (X & Y coordinates) of both Venus & Earth for 3000 points in time, each incremented by m 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.
For more about this technique read – interactive network chart to map relationships between people.
So during each step of the animation, we add more coordinates 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 coordinates 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 coordinates. 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 redraw the chart. That is all.
Download the Earth Venus dance workbook
Click here to download the Earth Venus cosmic dance workbook. Enable macros to enjoy the dance. Play with form control to adjust the animation speed and pattern. Examine the data tab to learn more about the calculations.
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,
 3D dancing pendulums in Excel
 Animated 4th of July fire works in Excel
 How “Donald Trump” happened – Animated Excel visualization
 How to create animated charts in Excel – a podcast tutorial
 More animation & advanced charting tutorials
 

Leave a Reply
Sumerian Voter Problem [IF formula homework]  Excel Tips, Tricks, Cheats & Hacks – Excel Ninja Edition 
3 Responses to “Earth Venus cosmic dance – Animated chart in Excel”
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.
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
@Ahmed
Can you please ask the question in the Chandoo.org Forums
http://forum.chandoo.org/
Please attach a sample file to simplify the response