let-us-play-polygonal-spirals

# πŸ€ Let Us Play Polygonal Spirals πŸ€ **Creating hypnotic patterns with Python's turtle graphics!** ![Python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge&logo=python&logoColor=white) ![Turtle Graphics](https://img.shields.io/badge/Turtle-Graphics-brightgreen?style=for-the-badge) ![Made with Love](https://img.shields.io/badge/Made%20with-%E2%9D%A4%EF%B8%8F-ff69b4?style=for-the-badge)

🎨 What’s This About?

Ever wondered what happens when you code geometric shapes that keep growing and spinning? You get mesmerizing spirals that are both mathematically elegant and visually captivating.

This repo explores polygonal spirals using Python’s built-in turtle graphics for interactive, educational, and artistic fun.
Great for beginners, educators, or anyone curious about creating generative art with code.


✨ The Collection

Each subfolder runs a classic or creative spiral:

πŸ”Ί Triangle Spiral

⬟ Pentagon Spiral

⬑ Hexagon Spiral

β­• Circle-ish Spiral


πŸš€ How to Run

  1. Clone the repo
    git clone https://github.com/willow788/let-us-play-polygonal-spirals.git
    cd let-us-play-polygonal-spirals
    
  2. Pick a spiral
    cd "Python Code Files/Triangle Code"
    # or Pentagon Code, or Hexagon Code, or Circle-like Code
    
  3. Run it
    python main.py
    
  4. Enjoy the show!

Requires only Python 3 (no extra libraries needed; turtle is included in the standard library).


🧠 How Does It Work?

  1. Choose a polygon: triangle, pentagon, hexagon, or a high-sided β€œcircle”.
  2. Compute the turning angle: 360 / number_of_sides.
  3. Start with an initial side length.
  4. Loop:
    • Draw a side,
    • Turn right by the angle,
    • Increase the length.
  5. Repeat for hundreds or thousands of iterations.
sides = 6        # hexagon, for example
angle = 360 / sides
length = 2
for i in range(iterations):
    turtle.forward(length)
    turtle.right(angle)
    length += 1

πŸ—‚οΈ Repository Structure

let-us-play-polygonal-spirals/
β”œβ”€β”€ Python Code Files/
β”‚   β”œβ”€β”€ Triangle Code/
β”‚   β”‚   └── main.py
β”‚   β”œβ”€β”€ Pentagon Code/
β”‚   β”‚   └── main.py
β”‚   β”œβ”€β”€ Hexagon Code/
β”‚   β”‚   └── main.py
β”‚   └── Circle-like Code/
β”‚       └── main.py
β”œβ”€β”€ Demonstration/
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
└── .gitignore

⭐️ Ideas for Expansion


πŸ“„ License

MIT License β€” see LICENSE.
You are free to use, modify, and share.


πŸ‘€ Author

Made with ❀️ by willow788


If these spirals delight you (or your inner child), give the repo a star!