Create Galactic Art with Tkinter. Model Mother Nature with Logarithmic… | by Lee Vaughan | Sep, 2023

Model Mother Nature with Logarithmic Spirals

A model of a spiral galaxy (by author)

One of the wonders of our world is that it can be described with math. The connection is so strong that MIT physicist Max Tegmark believes that the universe isn’t just described by math, but that it is math in the sense that we’re all parts of a giant mathematical object [1].

What this means is that many seemingly complex objects — across mind-boggling scales — can be reduced to simple equations. Why does a hurricane look like a galaxy? Why is the pattern in a nautilus shell repeated in a pinecone? The answer is math.

Examples of logarithmic spirals in nature (from “Python Tools for Scientists” [2])

Besides their appearance, the objects pictured above have something in common: they all grow, and growth in nature is a geometric progression. Spirals that increase geometrically are considered to be logarithmic, due to the use of the base of the natural logarithm (e) in the equation that describes them. While generally known as logarithmic spirals, their ubiquity in nature has earned them an additional title: spira mirabilis — “miraculous spiral.”

In this Quick Success Data Science project, we’ll use logarithmic spirals and Python’s Tkinter GUI module to simulate a spiral galaxy. In the process, we’ll generate some attractive and unique digital art.

Modeling a spiral galaxy is all about modeling spiral arms. Each spiral arm can be approximated by a logarithmic spiral.

Schematic plan view of spiral galaxy (by author)

Because spirals radiate out from a central point or pole, you’ll more easily graph them with polar coordinates. In this system, the (x, y) coordinates used in the more familiar Cartesian coordinate system are replaced by (r, Ɵ), where r is the distance from the center and Ɵ (theta) is the angle made by r and the x-axis. The coordinates for the pole are (0, 0).

Source link

Be the first to comment

Leave a Reply

Your email address will not be published.