Get the latest tech news

Visualizing distributions with pepperoni pizza and JavaScript


javascript) Monday, August 18, 2025 There's a pizza shop near me that serves a normal pizza. I mean, they distribute the toppings in a normal way.

The colloquial understanding of "random" is kind of the Platonic ideal of a pizza: slightly chaotic but things are more or less spread out over the whole piece in a regular way. (It's an outrageous amount of very small pepperoni, chosen in both axes for ease of visualizing the distribution rather than realism.) We'll do this by passing in the center and generating coordinates around those, while still checking that we're within the bounds of the circle formed by the crust of the pizza.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of javascript

javascript

Photo of pepperoni pizza

pepperoni pizza

Photo of nicole web

nicole web

Related news:

News photo

Show HN: I've made an easy to extend and flexible JavaScript logger

News photo

Starting game development in JavaScript with no experience

News photo

JavaScript retro sound effects generator