Chapter 1 of The Nature of Code, Vectors, introduces the vector as the unit of motion and builds fields by combining vectors across space. Wind is a physical vector field: every location has a speed and a direction.
I skip the hand-drawn field and sample a live Open-Meteo wind forecast, then integrate streamlines through those measured vectors.
The page samples Open-Meteo forecast wind (wind_speed_10m, wind_direction_10m) at nine points, converts each speed and bearing to a vector, and bilinearly interpolates between them. Test points are integrated along the field to trace streamlines, and line color encodes local speed. This is Chapter 1’s vector field applied to measured data instead of a synthetic function.
A vector field assigns a vector to each point, \(\mathbf{v}: \mathbb{R}^2 \to \mathbb{R}^2\). Meteorological direction \(\phi\) is the bearing the wind blows from, so the flow vector for speed \(s\) is \(\mathbf{v} = s\,(-\sin\phi, -\cos\phi)\). Interior values use bilinear interpolation, \(f(x,y) = (1-u)(1-v)f_{00} + u(1-v)f_{10} + (1-u)v\,f_{01} + uv\,f_{11}\). Streamlines are integral curves of the field, \(\frac{d\mathbf{r}}{dt} = \mathbf{v}(\mathbf{r})\), traced here by forward Euler steps \(\mathbf{r}_{n+1} = \mathbf{r}_n + h\,\hat{\mathbf{v}}(\mathbf{r}_n)\).
Data source: Open-Meteo Forecast API
Endpoint:https://api.open-meteo.com/v1/forecast?latitude=...&longitude=...&hourly=wind_speed_10m,wind_direction_10m
Access: Public, no key. Loaded from an hourly server-side refresh when possible, with a bundled snapshot fallback, and a live browser fetch only when the API allows CORS. Data window: Aug 6, 2026 (pulled Aug 6, 2026 UTC)
All 9 grid points are listed below.