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 27, 2026 (pulled Aug 27, 2026 UTC)

Latest data pull 9 rows
Aug 27, 2026 (pulled Aug 27, 2026 UTC)
Latitude
Longitude
Wind speed (km/h)
Wind direction (°)
40.7
-76.01
2.3
162
42.7
-76.01
13.1
164
44.71
-75.99
14.9
173
40.7
-73
25.6
184
42.72
-73.01
8.8
192
44.69
-73
11.3
143
40.69
-70.01
7.4
194
42.69
-70.01
19.7
201
44.69
-70.02
2.3
39

All 9 grid points are listed below.