Málaga province, drawn with Fourier epicycles

The maths behind the drawing

x(t) = a₀ + Σ [aₖ cos(kt) + bₖ sin(kt)]

y(t) = c₀ + Σ [cₖ cos(kt) + dₖ sin(kt)]

Each arm is one sinusoid: a vector that turns k times per full turn.
rₖ = √(aₖ² + bₖ²) · φₖ = atan2(−bₖ, aₖ)

Málaga province at N = 150 · RMS path error 0.07 %

First harmonic amplitudes: x₁ = 62.8 km · y₁ = 42.8 km

1

Automatic sequence: N rises from 1 to 150; each turn adds harmonics and the outline sharpens. Move the slider to pick N yourself.

Download video

Square 1080 px MP4, 48 s and 10.6 MB, ready for social media.

Province outline: © OpenStreetMap contributors (ODbL), simplified to 80 m and resampled to 1,024 points evenly spaced along its 598 km perimeter. The pen starts in Málaga city. The yellow chain makes x(t), the teal one y(t), and the pen sits where their projections cross. See the boundary on OpenStreetMap

How circles draw a map

Any closed line can be written as a sum of circular motions: a Fourier series. Here this outline (Málaga province) is split into two series, one for the horizontal coordinate x(t) and one for the vertical y(t). Each term is a vector that turns k times per lap; chained together they form the two arms, and the pen sits where their projections cross.

With a single term (N = 1) you only get an ellipse. Every extra term adds detail: around a dozen make the shape recognisable, and with 150 the error is 0.07% of its diagonal.

The data

The outline comes from OpenStreetMap (© OpenStreetMap contributors, ODbL). It follows the coastline and encloses 7,317 km², practically the official area of the province. For the drawing it was simplified to 80 m and resampled into 1,024 points evenly spaced along its 598 km; the pen starts in Málaga city.