Noise functions are a way to produce continuous pseudorandom values across one or more dimensions. The simplest example is a one-dimensional noise function that makes the y-value wobble up and down smoothly, but unpredictably as you move along the x-axis. It’s also possible to produce 2-dimensional noise, where the amplitude of the noise depends on […]
Meandering Triangles
Contour lines, also known as isolines, are lines drawn along along paths of constant elevation. They are often used when drawing maps to indicate the slope of hills and mountains: But they can also be used to visualize functions that map (x,y) values to z values, or to find the boundaries of implicit surfaces. One […]
A Faster Weighted Random Choice
Author’s note: After writing this post, someone linked me to a better algorithm, so check that page out for a more in-depth explanation of it. This post contains an overview of the problem and some visualizations and Python implementations of some commonly used algorithms and a new one too, so feel free to keep reading. […]