Skip to main content
100%

Gaussian Primes - MrWatson after Jason Davies

✓ Published0🌍 Public
RRussell Watson
Last edited Feb 6, 2020
Created on Feb 1, 2020

This visualization plots Gaussian primes as filled squares on the complex plane, with the pattern emerging across a grid of integers. It uses d3.v5 to render the SVG elements, with a custom `isGaussianPrime` function that checks the criteria for primes on the axes and in the interior. The code generates points by iterating over a symmetric range and applies a static rendering, with a circular clipping mask defining the visible area. The implementation follows Jason Davies’ original approach, though the developer notes that a cached prime-checking function underperforms the simpler dynamic version.

AI-generated description

A visualisation of Gaussian Primes using d3, following Jason Davies Gaussian Primes visualisation.

This is a plot of the complex plane showing <a href="http://mathworld.wolfram.com/GaussianPrime.html">Gaussian primes</a> as filled squares.

DONE:

  • Corrected a bug in the rendering of gaussian primes lying on the axes
  • Implemented on vizhub

Not working

  • Implements a cached IsPrime function
    • but it seems to be slower than the simple dynamic isPrime function
    • ...why?

TODO

  • Transition/animate the points as they are calculated

Maybe still a useful video to look at:

MIT Licensed

Similar vizzes