Skip to content

Repository files navigation

Python License GUI

Kakeya Needle Lab

An interactive desktop application for exploring the classical Kakeya Needle Problem through geometry, animation and mathematical visualization.

The application demonstrates how a unit-length needle can rotate through all possible directions while remaining inside different planar regions. It includes multiple geometric shapes, density visualization, endpoint trajectories, animated motion and export capabilities.

Sample View


Features

  • Interactive needle animation
  • Circle, Square, Triangle and Deltoid regions
  • Endpoint trajectory visualization
  • Needle center trajectory
  • Swept density heatmap
  • Perron Tree overlay
  • Real-time geometric metrics
  • Zoom and Pan
  • High-resolution PNG export
  • Animated GIF export
  • Modular architecture

Installation

Clone the repository

git clone https://github.com/your_username/kakeya-needle-lab.git

cd kakeya-needle-lab

Install dependencies

pip install -r requirements.txt

Run

python app.py

Controls

Action Description
Mouse Wheel Zoom
Left Mouse Drag Pan
Play Start animation
Pause Stop animation
Path Slider Select animation position
Save PNG Export current frame
Save GIF Export full animation

Visualization Options

  • Needle
  • Endpoints
  • Center
  • Boundary
  • Region
  • Grid
  • Endpoint Paths
  • Center Path
  • Swept Density
  • Heatmap
  • Perron Tree Overlay

Export

PNG

Export the current visualization as a high-resolution PNG image.

GIF

Render and export a complete 360° motion cycle as an animated GIF.

Configurable options include:

  • Number of frames
  • Frame duration
  • Infinite looping

Project Structure

kakeya-needle-lab/

├── app.py
├── export.py
├── geometry.py
├── raster.py
├── renderer.py
├── scene.py
├── ui.py
├── requirements.txt
│
├── motion/
│   ├── base.py
│   ├── circle.py
│   ├── deltoid.py
│   ├── factory.py
│   ├── polygon.py
│   ├── square.py
│   └── triangle.py
│
├── constructions/
│   └── perron.py
│
├── widgets/
│
└── tests/

Mathematical Background

The Kakeya Needle Problem, proposed by Soichi Kakeya (1917), asks for the smallest planar region in which a unit-length needle can be continuously rotated through 360 degrees.

Subsequent work by A. S. Besicovitch showed that such sets may have arbitrarily small area, leading to one of the most fascinating topics in geometric measure theory.

This application focuses on interactive visualization of these geometric ideas rather than formal proofs.


Technologies

  • Python
  • Tkinter
  • NumPy
  • Pillow
  • Matplotlib

Roadmap

Completed

  • Interactive animation
  • Multiple geometric regions
  • Density visualization
  • Perron Tree overlay
  • PNG export
  • GIF export
  • Zoom & Pan

Future Ideas

  • Besicovitch construction
  • SVG export
  • MP4 export
  • Mathematical reports
  • Additional Kakeya constructions

Acknowledgements

This project was developed as an educational and visualization tool for exploring classical geometry, geometric motion and the Kakeya Needle Problem.

About

Interactive desktop application for exploring the Kakeya Needle Problem with geometric animations, density visualization, Perron Tree overlays and GIF/PNG export.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages