Home Artificial Intelligence Create Galactic Art with Tkinter The Polar Equation for a Logarithmic Spiral

Create Galactic Art with Tkinter The Polar Equation for a Logarithmic Spiral

0
Create Galactic Art with Tkinter
The Polar Equation for a Logarithmic Spiral

Model Mother Nature with Logarithmic Spirals

Towards Data Science

11 min read

19 hours ago

A model of a spiral galaxy (by writer)

Considered one of the wonders of our world is that it could actually 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 within the sense that we’re all parts of an enormous mathematical object [1].

What this implies is that many seemingly complex objects — across mind-boggling scales — may be reduced to easy equations. Why does a hurricane seem like a galaxy? Why is the pattern in a nautilus shell repeated in a pinecone? The reply 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: all of them grow, and growth in nature is a geometric progression. Spirals that increase geometrically are considered to be logarithmic, as a result of the usage of the bottom of the natural logarithm (e) within the equation that describes them. While generally generally known as logarithmic spirals, their ubiquity in nature has earned them an extra title: spira mirabilis — “miraculous spiral.”

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

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

Schematic plan view of spiral galaxy (by writer)

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here