I'll create an immersive supercell radar simulation. Let me start by exploring the project structure, then build a particle-physics-based storm simulation with a radar renderer.
Let me look at the existing setup files.
Now I understand the setup. Let me plan the architecture:
- Physics engine (
src/sim/physics.ts) — A 2D particle system simulating storm parcels: updrafts, precipitation particles carried by mid-level rotation (helicity/mesocyclone), driven by CAPE (buoyancy/updraft strength), shear, moisture, etc. Includes a storm lifecycle (growth → mature hook echo → dissipation).
- Radar renderer (
src/sim/radar.ts) — Renders particles onto a canvas as reflectivity (dBZ color scale) or velocity (red/green Doppler) using density accumulation grids.
- UI (
App.tsx + components) — Radar display, mode toggle, sliders for ingredients, time controls.
Let me build the physics engine first.
Now the core physics engine. This models a supercell mesocyclone with a rotating updraft, spawning particles that get advected by a velocity field, forming the characteristic hook echo and forward flank.
Let me fix that unused variable — it's actually used. Let me check line 180.
The anvil branch uses anvilDir not a. Let me remove the unused a.
Now the radar renderer. It rasterizes particles into a density/reflectivity grid and applies proper NWS color scales (green→yellow→red→magenta for reflectivity, red/green for velocity).
Now let me create UI components: a slider control and a legend. Then the main App with the radar canvas, overlay grid (range rings, town), controls, and animation loop.
Now let me add custom slider thumb styles to the CSS, then build the main App.
Now the radar overlay (range rings, radar sweep) and legend components.
Now the color legends for each mode.
Now the main App component that ties everything together with the animation loop, controls, and radar display.
Now let me update the title and build the project.
The build succeeds. Let me review the physics for one potential issue: the storm center starts at (-70,-60) and moves NE. With high storm motion it could drift off-screen quickly. Let me verify the motion math produces reasonable on-screen travel and that the hook forms visibly. Let me check the motion scaling.
The motion uses speedKmS * dt * 20. With stormMotion=30kt → ~0.0154 km/s × dt × 20. At mature phase running ~1500s sim time, that's meaningful travel. This is fine.
Let me verify one concern — the mesocyclone offset placement so the hook wraps properly. The hook particles spawn around (mx, my) and rotate cyclonically, which will naturally create the wrapping hook appendage on the rear-flank. Good.
The simulation is complete and builds successfully. Here's what I built:
Supercell Simulation — WSR-88D Emulator
Architecture (physics + separate renderer, as requested):
-
Particle physics engine (src/sim/physics.ts) — A 2D parcel system where hydrometeors are spawned and advected through a velocity field. It models:
- A Rankine-vortex mesocyclone that imparts cyclonic tangential + inflow velocity to particles
- Distinct particle kinds: core (high dBZ hail/rain), forward-flank cascade, hook (wraps around the meso), and anvil
- A full lifecycle: cumulus → developing → mature → dissipating → dead, with timing/intensity driven by the ingredients
- Convective initiation gated by CIN, deviant rightward storm motion, and a storm that dies out based on its ingredients
-
Radar renderer (src/sim/radar.ts) — Completely separate. It splats particles onto a 220×220 accumulation grid, computes effective dBZ and reflectivity-weighted radial velocity per cell, then color-maps using authentic NWS reflectivity scale (green→yellow→red→magenta) and Doppler velocity scale (green=inbound / red=outbound).
Features:
- Toggle Reflectivity ↔ Velocity — during the mature phase you'll see the classic hook echo in Z and a tight inbound/outbound couplet in V (with a TVS alert)
- Live sliders: CAPE, Storm-Relative Helicity, Deep-Layer Shear, Moisture, LCL, CIN, Storm Motion — each genuinely affects growth, rotation, and longevity
- Time warp (0.5×–8×) plus Start/Pause/Reset
- Range rings, radar sweep, town markers, live HUD (phase, storm age, meso %), and presets (Tornadic / Classic / Marginal / HP Storm)
Press START with the Tornadic preset and watch the cell grow, organize, and curl into a hook — then flip to Velocity to catch the couplet.
Files built: src/sim/types.ts, src/sim/physics.ts, src/sim/radar.ts, src/components/Slider.tsx, src/index.css, src/components/RadarOverlay.tsx, src/components/Legend.tsx, src/App.tsx, index.html