Mobile-analytics SDKs (Firebase, Amplitude, Hotjar-style session recorders) log every tap as a raw (x, y, t) event. A touch heatmap turns that stream into a continuous surface with 2D kernel density estimation: each tap deposits a Gaussian "splat" on a grid, and overlapping splats sum into hot zones.
For a tap at (x0,y0), grid cell (x,y) gains:
ΔI(x,y) = A · exp( -((x-x0)² + (y-y0)²) / (2σ²) )
Between ticks the whole grid decays exponentially
(a rolling session window, not infinite memory):
I(x,y) ← I(x,y) · exp(-λ·dt), λ = ln(2) / half-life
This 2D counterpart renders the same density field directly as a flat map instead of a 3D-textured phone screen, and adds two analyses a 3D perspective view can't show cleanly:
- Isodensity contours — traced with a marching-squares pass over the grid at three density thresholds, the same way a topographic map connects points of equal elevation. Tight nested contours mean a sharply localized hot zone; widely spaced contours mean a broad, diffuse one.
- Marginal density profiles — the grid summed along each axis, Ix(x) = Σy I(x,y) and Iy(y) = Σx I(x,y). Integrating a 2D Gaussian over one axis leaves a 1D Gaussian in the other, so these strips are literally the row/column sums of the same field — they show exactly where taps cluster horizontally and vertically without needing to read the 2D map by eye.
- Tap rate — events/second arriving from the simulated user session.
- Kernel bandwidth σ — how far a single tap's influence spreads; small σ shows exact touch points, large σ approximates finger/thumb contact area.
- Decay half-life — how long a tap keeps contributing before the analytics window "forgets" it.
- Realistic vs Uniform — realistic mode samples taps from three weighted UI zones (top search bar, center feed, bottom nav icons); uniform mode is the structureless null model.
Real-world relevance: this is the same aggregation mobile analytics platforms run over millions of raw touch events to answer "where do users actually tap" — informing button placement, nav-bar redesign and dead-zone detection. The 3D counterpart renders the identical density field as a texture on a phone mesh you can orbit around.