Simulations
103 interactive simulations, grouped by area. Everything runs live in the browser, drag, tune and watch the maths move. Open an area to see what is in it.
Calculus16
Limits, derivatives, integrals and the geometry behind them.
Calculus16
Limits, derivatives, integrals and the geometry behind them.
Derivative as a Limit
Slide the secant line as h shrinks to zero and watch it settle into the tangent, then zoom in until the curve itself is a straight line, unless there is a corner.
Partial Derivatives
A surface has a slope for every direction you could walk. Freeze one variable and slide a plane through it for ∂f/∂x or ∂f/∂y, then turn the plane to any direction u and watch D_u f = ∇f·u peak along the gradient.
The Fundamental Theorem
Sweep a point across a curve and watch the area behind it grow into a new function, whose slope at every point is the height of the curve. Riemann sums, signed area and the +C included.
Derivative Rules
Sum, product and chain in one place. Stacked graphs make the slopes add, a growing rectangle leaves two strips and a doomed corner, and a step stretched twice multiplies the factors.
Second Derivatives & Curvature
Join the two points either side of you with a straight line. The curve misses the middle of it, and that gap is the second derivative. Halve the spacing and the gap falls to a quarter.
Integration by Parts
Two areas that tile one rectangle: the integral you were asked for and the one you are handed back. Choosing u is choosing which of the two you would rather do.
Differential Equations
An equation for the slope instead of the value. Draw it everywhere and the plane fills with segments; a solution is any curve that stays tangent to them the whole way, and a swarm of particles shows them all at once.
Taylor Series
Add polynomial terms one by one and watch the approximation hug a curve near a point, then fall apart past its radius of convergence, set by the nearest singularity in the complex plane.
Fourier Series
Multiply the signal by one frequency and add up the area. If the wave fits, the product sits above the axis; if it does not, the halves cancel to exactly zero. Every coefficient is that one measurement.
Laplace Transform
Plot |F(s)| as a landscape over the complex plane, where poles become spikes and the Fourier transform is the slice above the imaginary axis.
The Hessian
A surface bends by a different amount in every direction, and four numbers hold all of them. Its eigenvectors are the sharpest and gentlest directions, and their signs decide bowl, dome or saddle.
Lagrange Multipliers
Optimize along a constraint and watch the objective contour kiss the constraint curve, exactly where the two gradients line up.
Line Integrals
Ride a bead along a curve through a field in 3D, adding up only the part of the field that points your way. Then bend the path and see whether the total cared.
Stokes' Theorem
Stretch any surface across a loop and chop it into patches. Neighbours walk every shared edge both ways, so the sum collapses onto the one curve around the edge. Lay it flat and this is Green's theorem; bend it and the answer refuses to move.
Gauss's Divergence Theorem
Fill a lumpy region with little boxes and count what leaks out of each. Every inner wall is shared by two boxes and cancels, leaving only the outer skin.
Divergence & Curl
Two numbers at every point of a flow. Drop in a material patch and its area grows or shrinks with the divergence; drop in a paddle wheel and it spins with the curl.
Linear Algebra11
Vectors, matrices and the transformations they encode.
Linear Algebra11
Vectors, matrices and the transformations they encode.
Linear Transformations
Drag the matrix entries and watch the plane deform with them, carrying the grid and the two basis vectors along for the ride.
Matrix Multiplication
Multiplying two matrices chains their maps: AB means apply B, then A. Run both orders side by side and watch the letter F end up in two different places.
The Determinant
One number for what a matrix does to area. Squash the parallelogram to nothing and the map has thrown a dimension away; push past that and the plane comes back inside out.
Systems of Equations
Two equations in two unknowns, seen two ways at once: as lines that cross, and as columns that add up to b. Elimination turns the lines about the answer without ever moving it.
Column Space & Null Space
A matrix squeezes its input space onto its column space and crushes its null space to zero. Drag a point along the null line and its image never moves; pull a column into the plane of the others and watch rank fall as nullity rises.
Change of Basis
The same arrow, watched through two different grids and written down as two different pairs of numbers. The dictionary between them is a matrix, the pairs it can reach are the span of the basis, and a transformation translated is the sandwich.
Eigenvectors & Eigenvalues
A matrix knocks almost every vector off its own line. Aim v until Av lands back on it: that is an eigenvector, and the stretch is λ.
Dot Product
One length times the shadow the other casts on it, with the component formula falling straight out of that one picture.
Projections & Gram–Schmidt
The closest point of a plane to a vector is where the error meets it at a right angle. The same picture fits a line to data, and done one direction at a time it straightens any basis into an orthonormal frame, A = QR.
Cross Product
Two vectors span a patch of area. Its size is the length of the answer, its tilt is the direction, and each component is a shadow of that patch.
Singular Value Decomposition
Watch any matrix turn a circle into an ellipse as rotate, stretch, rotate, the geometry of A = U Σ Vᵀ. Then keep only the biggest singular values and compress a picture.
Statistics10
Randomness, distributions and the patterns that emerge from them.
Statistics10
Randomness, distributions and the patterns that emerge from them.
Central Limit Theorem
Add up n draws from any distribution, over and over. The sums and the means pile into a bell whatever the source looked like, and with ±1 coin steps each sum is a random walk spreading like √n.
Joint, Marginals & Conditionals
Every pair of values gets a square whose area is its probability. Drag a box over the table and read the joint, the marginals and a conditional off one selection.
Covariance Matrix
Every point and the mean are opposite corners of a rectangle, positive or negative by where the point sits. Covariance is the average of those signed areas, the variances are the squares, and correlation is what is left once the units are divided out.
Probability Density
Grains of sand fall where a random quantity lands and pile up; per unit of width the pile becomes the density curve. Then the area is the share of grains, a squeezed pile climbs past 1, and one exact point catches nothing.
Monte Carlo
Throw random darts at a box and count the hits: the fraction times the box is the area. Estimate π, the area under a curve or a ball's volume in ten dimensions, and watch the error fall like 1/√n.
Bayes' Theorem
See why a 90% accurate test for a rare disease is usually wrong when it says positive. 1,000 people as dots make the posterior obvious.
Maximum Likelihood
Slide a Gaussian over sample data and watch the likelihood rise and fall. The best fit lands on the sample mean and the spread that divides by n, not n − 1.
Wasserstein Distance
Measure the distance between two distributions as the least work to reshape one into the other, the area between their CDFs.
Information and Entropy
A bit is one yes/no answer. Find a card in 16 with four of them, see why rare news takes more questions, send the weather in 1.75 bits a day, and pour the questions flat to find the entropy.
KL Divergence
The extra surprise of believing Q while the world draws from P. Watch samples land and their surprise add up, see the gap as red and blue area, find why the two directions differ wildly, and fit a bell both ways.
Machine Learning11
Clustering, model fitting and the ideas that turn data into predictions.
Machine Learning11
Clustering, model fitting and the ideas that turn data into predictions.
k-Means
Assign points to the nearest center, move each center to its mean, repeat. Watch clusters snap into place, and sometimes into the wrong place.
Gaussian Mixtures
k-means hands every point to one cluster and draws only circles. A mixture gives every point a share of each cluster instead, and lets a cluster stretch and tilt, so a point between two of them can finally say so.
DBSCAN
Density-based clustering that finds arbitrary shapes and flags outliers as noise, with no need to choose the number of clusters up front. A second view works out reachability and connectivity on small cases, one point at a time.
Hierarchical Clustering
Merge the two closest groups over and over until everything is one, watch the dendrogram grow branch by branch, and drag a cut across it to choose the clusters.
Clustering Metrics
Silhouette, Davies–Bouldin and DBCV judge a clustering by its geometry alone; purity, the Rand index and ARI hold it up against the true classes. Split, scramble and hand-edit clusters and watch where the six scores part ways.
Linear Models
Linear and logistic regression score the input with the same line, z = wx + b. Draw each residual as a literal square, snap to the least-squares optimum, and watch the same descent fit both models.
Overfitting
Raise a polynomial’s degree until it threads every training point yet fails on new data, then tame it with regularization.
The Curse of Dimensionality
Add axes and space stops behaving: data thins out, a ball keeps its volume in a paper-thin crust, and near and far collapse into the same distance.
Principal Component Analysis
Keep one number per point: its shadow on a line. Turn the line and watch the spread it keeps rise and fall; the best line keeps the most, loses the least, and is the top eigenvector of the covariance.
Perplexity of a Neighbourhood
Put a Gaussian on one point and its neighbours become probabilities. Perplexity counts how many of them really count, and a binary search finds the width that makes the count come out right: narrow in a crowd, wide for a loner.
t-SNE
Tie each point of a 3D cloud to its neighbours with threads, throw everything on a flat page, and let the threads pull while all points push apart. The map that settles keeps who was next to whom.
Deep Learning13
Optimization, neural networks and the math that trains them.
Deep Learning13
Optimization, neural networks and the math that trains them.
How Layers Bend Space
Every hidden layer is two units wide, so the space it makes can be drawn. Step through the layers and watch the grid fold until one line separates the classes.
Backpropagation
One tiny network, one example, every number on screen. Push the input forward, send the error back down the same wires, then see why the activation's slope decides whether a gradient survives many layers.
Optimizers
Six optimizers descend the same loss: a 1D slice where too big a learning rate overshoots and diverges, a surface you can click on, or a density cloud in three parameters.
Batch Size & Gradient Noise
Nobody computes the real gradient. Watch which examples get drawn, watch each one pull the step its own way, and watch their average swing into line with the truth as the batch grows.
Initialisation & Normalisation
Every layer multiplies the spread of the signal by a factor, and depth compounds it. Pick a weight scale and watch the activations survive, vanish or overflow, then normalise each layer and see the scale stop compounding.
Softmax & Temperature
Raw scores become probabilities, and one number decides how strong an opinion that is. Drag the temperature from a single confident answer all the way to a five-way shrug.
Inside a Digit Classifier
Draw a digit and watch a pretrained MNIST classifier read it, as a plain stack of layers or as a convolutional network. Every wire is lit by what it carries, and clicking a neuron opens it up to show the picture it looks for.
Contrastive Learning
Nobody says where anything goes. Things of a kind are pulled together and everything else pushed apart, and the embedding arranges itself from that. Four losses say it four different ways, and you can watch each one push.
Embeddings & Cosine Similarity
Every word is an arrow and meaning is the direction it points. Rank the same words by cosine, by raw dot product and by straight-line distance, and watch the level sets turn from rays into rings.
Positional Encoding
Attention reads a set, so order has to be written into the vectors. Added sinusoids make a score depend on where two words sit; rotary makes it depend on their offset alone.
Convolution
A window of weights slides over a grid and each position gives one number. Padding, stride and dilation decide how many positions there are, and with several channels every filter reads all of them at once and sums the slices.
Receptive Field
Trace the cone of pixels one output cell can see. Depth adds to the window, stride multiplies it and costs resolution, doubling dilation grows it exponentially for free, and a repeated dilation leaves holes.
Autoencoder & Latent Space
Squeeze a picture through a gap of two numbers and force the network to rebuild it. Nothing says what the numbers should mean, and they come out as a map you can drag around.
Computer Vision5
What can be measured in a picture, and what has to be guessed.
Computer Vision5
What can be measured in a picture, and what has to be guessed.
Image Representation
A photograph in memory is a grid of whole numbers and nothing else. Move the magnifier and the same patch is a picture and its numbers at once, then take the numbers apart: one channel at a time, and fewer and fewer values each.
Image Filters
A filter is a small square of numbers. Slide it over a photograph and the same handful of weights will blur it, sharpen it or leave nothing but its edges. Pick one, resize it, or drag the weights until it is yours.
Finding an Object
A detector is a picture of the thing you want and a window that walks the scene asking how much this looks like that. Drag the window about, or set it sweeping, and watch a score appear at every position and every size before any box exists.
Boxes and Overlap
A detector returns a heap of overlapping guesses, not one box per object. Two rules turn the heap into an answer: a number for how much two boxes are the same box, and a procedure that keeps the best and deletes its neighbours.
Shape from Shading
A photograph is flat, yet you see a surface in it. Brightness is decided by how each patch leans towards the light, and turning that around recovers the shape, provided you guess the light right.
Generative AI3
How models learn the shape of data and generate new samples from it.
Generative AI3
How models learn the shape of data and generate new samples from it.
The Data Manifold
Every 28 × 28 image is a point in a 784-dimensional space, yet real images of one kind lie on a thin curved sheet inside it. Walk the sheet, average two images, add noise and pull it back.
Byte Pair Encoding
Glue the commonest pair of neighbouring symbols into one, over and over, and watch a vocabulary grow from bare letters into whole words.
Autoregressive Models
A 40-word vocabulary with a probability for every word at every step, and temperature, top-k and top-p deciding which of them survive to be sampled.
Physics21
Fields and the equations that move energy through space.
Physics21
Fields and the equations that move energy through space.
Electromagnetic Waves
Shake a charge and watch its field ripple outward as a glowing shell, at the speed the medium allows. Build a dipole antenna to see its radiation glow as a doughnut round the wire, with E and B turning transverse in 3D, or switch to statics for Coulomb field lines and the magnetic circles round a wire.
Wi-Fi in a House
Maxwell's equations on the GPU over a whole house at the true Wi-Fi wavelength: watch 2.4 and 5 GHz spill through doorways, leave dead spots a few centimetres across and fade behind brick and concrete, with the signal a phone would read in every room.
Entropy
Lift the wall and a gas fills its box. Flip every velocity and it flows home; nudge one particle by a billionth and it never does. Entropy counts arrangements, and chaos makes the count win.
Heat Equation
Watch heat diffuse through a 3D room as glowing fog, from a radiator to a cold window, paint in your own heat or cold, and see a thermometer settle into steady state.
Wave Equation
A drum skin where every point accelerates toward the average of its four neighbours. Put a probe anywhere and watch that pull live: down on a crest, up in a trough, nothing on a straight slope. Swap in the heat equation and the same pull only slides the point into place.
Normal Modes
Every object has a few shapes it can hold while it vibrates, each ringing at its own note. Pluck it and the motion splits into those notes: whole multiples on a string, an untuned jumble on a drum.
Phonons
Every mass obeys Hooke’s law and pulls only on its neighbours. Out comes a pulse travelling at a speed nobody wrote down, and a shortest possible wavelength.
Wave Interference
Two sources of ripples cross and combine into bright and dark fringes. Drag the sources to see the pattern behind the double-slit experiment.
Ideal Gas
A few hundred atoms in a glass cylinder under a piston. Pressure is the drumming of their impacts, temperature is how fast they fly, and PV = NkT is what that adds up to: squeeze, heat or insulate and watch it hold.
Stationary Action
Bend the path a particle takes between two fixed events and watch its action get worse. Rolling that downhill turns out to be Newton in disguise.
Band Theory
Bring a line of atoms together and every level splits into a band. Which bands are full, and how wide the gap is, decides metal, semiconductor or rock.
Quantum Tunnelling
Fire a wave packet at a wall taller than its energy. Classically it bounces straight back; as a wave, part of it leaks through the wall and out the far side.
Wavefunction Collapse
A matter wave spreads through space as a cloud of probability until a measurement finds it at one single point. Fire particles at a screen one by one and the interference fringes build up dot by dot.
Atomic Orbitals
The exact hydrogen orbitals drawn as glowing clouds of probability: shells and nodal planes, the phase winding of m, the signed lobes of chemistry, measurements that collapse the cloud to a point, and superpositions that slosh and emit light.
Stern-Gerlach Experiment
A beam of atoms should smear into a band and arrives as two spots. Chain the analysers, turn the next one, and measuring x wipes out what was known about z.
Quantum Gates
Build a circuit on two qubits and watch the amplitudes, their phases and both Bloch arrows move together. Then build the one circuit whose arrows shrink to nothing.
Nuclear Fission
One neutron splits one nucleus and two more fly out. Turn the enrichment, the size and the control rods and watch the chain die, hold steady, or run away.
Nuclear Fusion
Slam light nuclei together hard enough to tunnel through their own repulsion, and chase the one line every star has to cross: power out beating power lost.
Special Relativity
Space and time are one fabric. Boost to a moving frame and its grid skews: clocks tick slow, rulers shrink, and simultaneity comes apart. Yet every arrow in spacetime keeps one length that all observers agree on.
General Relativity
Hang two clocks above a black hole, a neutron star or the Earth: the low one runs slow, so its light flashes arrive stretched, and a clock carried down comes back younger. Then lay a ruler between two circles and it needs more rungs than their circumferences allow: space is curved too, not just time.
Black Hole
See a black hole the way its light does: every pixel is a photon traced through curved spacetime, so the disk wraps over the top and the sky folds round a shadow 2.6 times the horizon. Then put a particle in orbit and watch it trace rosettes, plunge inside 3 rₛ, and its clock run slow.
Cosmology5
The universe at every scale, drawn from real catalogues: how far things are, how we see them, and how space itself grows.
Cosmology5
The universe at every scale, drawn from real catalogues: how far things are, how we see them, and how space itself grows.
From the Big Bang to Galaxies
One box of the universe from a split second after the Big Bang to today, across 54 orders of magnitude in time: quarks lock into protons, helium forms in three minutes, the glowing fog clears into the microwave background, and the seeds of inflation grow into the cosmic web.
A Journey Through the Universe
Fly from the planets to the edge of what we can see, through 45,000 Hipparcos stars, the Local Group, 43,000 galaxies of the 2MASS Redshift Survey and 42,000 SDSS quasars, to the cosmic microwave background as WMAP mapped it.
Travelling Near the Speed of Light
Pick a speed and see the real sky three ways: as Earth maps it, as the ship measures it, and where its light set out from. A ladder of scales from the Moon to the Coma Cluster shows how near everything gets, and how long the trip takes on your own clock.
Hubble Expansion
A box of galaxies carried apart by growing space. Stand on any of them and the rest recede as v = H d, so none is the centre. Change the matter and dark energy and watch the expansion slow, accelerate or turn round, and stretch a photon on its way across.
The Observable Universe
Why we see 46 billion light-years in a universe 13.8 billion years old, and why some of the galaxies we see are already out of reach. Three horizons as spheres through cosmic time, and our past light cone in 3D, shaped like a teardrop.
Electronics8
The components a circuit is built from, opened up: charge, fields and carriers doing the work.
Electronics8
The components a circuit is built from, opened up: charge, fields and carriers doing the work.
Resistor
The field pulls an electron along and the lattice knocks it back to random, over and over. The average of that stop-start crawl is the current, and the winnings the lattice keeps are the heat.
Diodes & Transistors
Pick a diode or a transistor and watch electrons and holes move through it: a one-way valve, then a valve with a knob, both built from a barrier you can raise.
Capacitor
Every charge is a ball you can count. Drive the source by hand and watch electrons get dragged off one plate, round the circuit, and onto the other one.
Inductor
A flywheel for charge. Shove the source and the electrons will not jump, only ramp, and cutting them off makes the collapsing field fight to keep them going.
Memristor
A resistor that remembers the charge that has been through it. Watch the boundary inside the film move as you drive it, and stay put when you stop.
RC, RL and RLC Circuits
A resistor, a coil and a capacitor in one loop. The two stores pass energy back and forth, so the circuit rings, and one number, the damping ratio ζ, decides whether it rings, settles as fast as it can or crawls. The same two poles decide which frequencies get through.
Transmission Lines
Close a switch on a two-wire line and watch the energy travel through the space between the wires, not down the copper, as a wave at v = 1/√(LC) that the load swallows, doubles or turns upside down.
MOSFET & CMOS Logic
A plate of metal that conjures a wire underneath itself and never touches it. Then stack a p-type one on an n-type one and get a gate that costs power only while it changes its mind.