# Alain's Curve

Polar · r = f(θ, t)

`r = sqrt((0.7 + 0.3 · sin(t))² · cos(θ)² − 1.44 · sin(θ)²) / cos(2θ)`

[Open in the app](https://www.wavelace.com/app#p=64) · [This page](https://www.wavelace.com/presets/alains-curve)

### What it draws

The formula is a curve of the plane written in polar form. Put `x = r·cos(θ)` and `y = r·sin(θ)` into `(x² − y²)² = a²x² − b²y²` and it becomes `r²·cos(2θ)² = a²·cos(θ)² − b²·sin(θ)²`, which is exactly what is on the plate. Here `b = 1.2`, since `1.44 = 1.2²`, and `a = 0.7 + 0.3·sin(t)`, breathing between `0.4` and `1.0` every `2π ≈ 6.28` seconds at `Speed` 1.

The square root is what shapes the picture. It is real only where `a²·cos(θ)² ≥ b²·sin(θ)²`, that is within `arctan(a/b)` of the horizontal. That wedge is `18.4°` wide when `a` is at its smallest and `39.8°` at its largest. Everywhere else the formula has no value and a gap is left, so two thirds of the angles are empty at rest.

### The two loops

Straight ahead, at `θ = 0`, the formula gives `r = a`. At the edge of the wedge the quantity under the root falls to zero, so `r` returns to the origin. Each lobe is a closed loop that leaves the centre, reaches out and comes back, and the two of them cross at the centre in a figure of eight. As `a` grows the wedge widens and both loops swell.

The denominator sets the limit. `cos(2θ)` vanishes at `45°`, and as long as `a` stays below `b` the wedge stops short of it and `r` stays finite. Let `a` reach `b` and the two meet: the loops tear open along the diagonals and run off to infinity. That is why the breathing is set to keep `a` under `1.2`. The curve is a rational quartic, and it is catalogued as Alain's curve after Alain Juhel, who proposed its study.

### Try

- Hold the breath with `√(0.49·cos(θ)² − 1.44·sin(θ)²) / cos(2θ)`, which is `a` fixed at `0.7`.
- Narrow the wedge by raising `b`: `√((0.7 + 0.3·sin(t))²·cos(θ)² − 4·sin(θ)²) / cos(2θ)` puts `b = 2`, and the lobes thin to slivers.
- Bring `a` up to meet `b` with `√((0.7 + 0.5·sin(t))²·cos(θ)² − 1.44·sin(θ)²) / cos(2θ)`: near the top of each breath the loops burst open and the scale-to-fit gives up on them.
- `Top` in the deck: the figure of eight seen flat, with the empty wedges above and below.

### Read more

- [Alain's Curve](https://mathcurve.com/courbes2d.gb/alain/alain.shtml)
- [Quartic plane curve](https://en.wikipedia.org/wiki/Quartic_plane_curve)
- [Lemniscate](https://en.wikipedia.org/wiki/Lemniscate)
- [Polar coordinate system](https://en.wikipedia.org/wiki/Polar_coordinate_system)
