Mean-Shift Clustering: 2D Contour Map & Density Cross-Section
Interactive 2D counterpart to the 3D kernel-density terrain: real marching-squares contour extraction of the same Gaussian KDE, fading climb trajectories for every point, and a draggable density cross-section curve — all computed independently from scratch, not reprojected from the 3D mesh.
This is a genuine, independently-computed 2D counterpart to the 3D kernel-density-terrain mean-shift simulator. Instead of shading a rotatable 3D mesh by height, it runs a real marching-squares pass over the same Gaussian kernel density estimate to extract crisp iso-density contour rings — the same technique used to draw topographic maps — while every data point's mean-shift climb is traced as a fading trajectory trail so you can watch the literal gradient-ascent path curve toward a density peak. A draggable horizontal scan line drives a second, entirely different view: a live 1D cross-section curve of the density function along that line, something a 3D terrain view has no equivalent of. The bandwidth slider reshapes the contour rings and the cross-section curve together in real time, making the same bias/variance trade-off directly visible from a completely different angle, while live readouts track iteration count, discovered cluster count and the shrinking average step size as the system converges.
Real marching-squares contour extraction of a Gaussian kernel density estimate, fading mean-shift climb trajectories for every point, and a draggable 1D density cross-section curve — a genuinely different, independently-computed 2D counterpart to the 3D KDE terrain simulator.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install