Skip to content

Latest commit

 

History

62 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Primes With Circles

Visualizing Prime Numbers through Kinetic Motion and Resonance.

image

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

🚀 Features

  • 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.

🧠 How it works: Cyclic Prime Emergence Algorithm

The core logic follows a geometric progression where primes are identified through synchronized rotations:

  1. Initialization: Start with two concentric circles of radius $r$ and $2r$.
  2. Motion: Rotate them with constant linear speed from the same starting point.
  3. Iteration: Each time the first circle completes a full rotation, increment a counter $n$.
  4. Detection: If no other circle finishes its rotation at the exact same time as the first, then the current counter value $n$ is prime.
  5. 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.

Watch the video: Watch the video

💡 Key features of this approach

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:

🛠️ Technical Details

  • 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

image image

About

fiding prime numbers using circles

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages