Visualizing Prime Numbers through Kinetic Motion and Resonance.
This project is a C# / WPF application that explores the emergence of prime numbers using rotating circles. Instead of a static sieve, it treats primality as a phenomenon of phase alignment and periodic motion.
License: GPL-3.0-or-later
- Kinetic Visualization: Watch prime numbers "emerge" as rotating phases.
- Pure C# / WPF: The animation is driven by CompositionTarget.Rendering.
- No External Dependencies: Zero third-party libraries; just clean, optimized code.
The core logic follows a geometric progression where primes are identified through synchronized rotations:
-
Initialization: Start with two concentric circles of radius
$r$ and$2r$ . - Motion: Rotate them with constant linear speed from the same starting point.
-
Iteration: Each time the first circle completes a full rotation, increment a counter
$n$ . -
Detection: If no other circle finishes its rotation at the exact same time as the first, then the current counter value
$n$ is prime. -
Growth: If
$n$ is found to be prime, add a new concentric circle with a radius of$n \times r$ .
This creates an open-ended, geometric simulation where primality emerges from phase alignment. Unlike the traditional Sieve of Eratosthenes, this approach requires no divisions and no predefined upper limit; it is a streaming visualization of number theory in motion.
While inspired by classical number theory, this implementation introduces two fundamental shifts:
- No explicit divisions: Primality is determined solely by geometric synchronization and phase alignment.
- Dynamic growth: The system functions as an expanding mechanical sieve. Every time a new prime is discovered, a new visual "oscillator" (circle) is added in real-time, influencing all future checks. Key features of this approach:
- Language: C#
- Framework: .NET / WPF
- Rendering: High-performance animation driven by CompositionTarget.Rendering, ensuring frame-perfect synchronization with the monitor's refresh rate.
You can view a full presentation at https://youtu.be/yKuR0GW0x7k
or read more details at https://nkode.gr/EN/articles/278/when-prime-numbers-emerge-from-motion
