Perlin noise produces smooth, continuous pseudo-random values, unlike the erratic jumps of raw random()
Perlin noise (developed by Ken Perlin, awarded an Academy Technical Achievement Oscar) is a gradient-based pseudo-random function designed to vary smoothly and naturally. Unlike random(), which jumps to an unrelated value in [0,1] on each call, Perlin noise at input n+1 is mathematically related to n — it changes gradually. You pass it a seed value (or a 2D/3D coordinate acting as a position in a smooth field) and receive a float between 0 and 1. Small increments to the input (0.01–0.1 per step) produce gentle wandering variation; larger increments (0.5+) produce more turbulent, abrupt change. This makes it the primary tool for organic-looking motion, texture, and form — ‘controlled unpredictability’ that feels hand-made rather than mechanical. Processing’s and p5.js’s noise() function encapsulates the algorithm and accepts 1, 2, or 3 parameters for 1D, 2D, or 3D noise. A common misconception: the return value is not random in the colloquial sense — it is fully deterministic given the same seed and coordinates.
Examples
Naturalistic waving line: y = height/2 + noise(ynoise)*80 - 40; stepping x across the canvas while advancing ynoise += 0.1 per step. 2D noise field: call noise(xnoise, ynoise) at each grid point and map the returned value to position, size, alpha, or rotation of each ellipse. Animate a circle’s radius over time between 50 and 150 by feeding an advancing input to noise().
Assessment
Write pseudocode using noise() to animate a circle whose radius varies smoothly over time, and explain why noise() gives a more visually pleasing result than random() for this. Given a sketch that places points with random(), replace it with noise()-driven placement, explain why the visuals differ, and predict what happens when you double the noise increment step.