The Gravity of Pi

Martin Krzywinski’s latest “Pi Day” graphic re-imagines numerical digits as physical masses

Join Our Community of Science Lovers!

This article was published in Scientific American’s former blog network and reflects the views of the author, not necessarily those of Scientific American


Since 2013, scientist and data graphics guru Martin Krzywinski has been celebrating “Pi Day” by visualizing the famous mathematical value in original and fascinating ways. This year, inspired by the recent announcement of the discovery of gravitational waves by LIGO scientists, Martin has dropped a complex new variable into his latest visualization: gravity. 

Like the interaction of physical masses, this visualization is governed by a set of laws. It starts with the first n digits of pi, each represented as a colored dot and arranged in a circle. The color of each digit signifies its value based on a rainbow scale of magenta to violet. The value of n could be anything, from three (3, 1, 4) to 1,000. Each digit is assigned a mass according to a mathematical formula including a second variable, k. The interactions of the masses are then visualized as paths connecting them. At times, masses come to orbit each other; in other instances they collide, coalescing into a larger mass whose increased gravity intensifies its impact on the other bodies around it. 

Depending on the respective values of n and k, the visualization experiences various permutations. As the values increase, the interplay of forces becomes more dramatic and complex, the path winding and looping around itself, often breaking the bounds of the circle and veering into graphical oblivion. In some instances, as in the one below, all the digits eventually collide into a single mass within the circle.


On supporting science journalism

If you're enjoying this article, consider supporting our award-winning journalism by subscribing. By purchasing a subscription you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.


Pi Day 2016 Graphic by Martin Krzywinski

Visit Martin’s website to read more about his process and see other variations on the visualization.

Amanda Montañez is senior graphics editor and been at Scientific American since 2015. She produces and art directs information graphics for the Scientific American website and print magazine. Montañez has a bachelor's degree in studio art from Smith College and a master's in biomedical communications from the University of Toronto. Before starting in journalism, she worked as a freelance medical illustrator. Follow her on Bluesky @unamandita.bsky.social

More by Amanda Montañez

It’s Time to Stand Up for Science

If you enjoyed this article, I’d like to ask for your support. Scientific American has served as an advocate for science and industry for 180 years, and right now may be the most critical moment in that two-century history.

I’ve been a Scientific American subscriber since I was 12 years old, and it helped shape the way I look at the world. SciAm always educates and delights me, and inspires a sense of awe for our vast, beautiful universe. I hope it does that for you, too.

If you subscribe to Scientific American, you help ensure that our coverage is centered on meaningful research and discovery; that we have the resources to report on the decisions that threaten labs across the U.S.; and that we support both budding and working scientists at a time when the value of science itself too often goes unrecognized.

In return, you get essential news, captivating podcasts, brilliant infographics, can't-miss newsletters, must-watch videos, challenging games, and the science world's best writing and reporting. You can even gift someone a subscription.

There has never been a more important time for us to stand up and show why science matters. I hope you’ll support us in that mission.

Thank you,

David M. Ewalt, Editor in Chief, Scientific American

Subscribe