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.
- 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
Clone the repository
git clone https://github.com/your_username/kakeya-needle-lab.git
cd kakeya-needle-labInstall dependencies
pip install -r requirements.txtRun
python app.py| 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 |
- Needle
- Endpoints
- Center
- Boundary
- Region
- Grid
- Endpoint Paths
- Center Path
- Swept Density
- Heatmap
- Perron Tree Overlay
Export the current visualization as a high-resolution PNG image.
Render and export a complete 360° motion cycle as an animated GIF.
Configurable options include:
- Number of frames
- Frame duration
- Infinite looping
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/
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.
- Python
- Tkinter
- NumPy
- Pillow
- Matplotlib
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
This project was developed as an educational and visualization tool for exploring classical geometry, geometric motion and the Kakeya Needle Problem.
