function curve(n, size = 800) {
let pts = d3
.range(0, 1, 1 / 2 ** n)
.concat([1])
.map(function (t) {
let [x, y] = h(t);
return { t, x, y };
});
return Plot.plot({
width: size,
height: size,
inset: 10,
x: { domain: [0, 1], ticks: 8 },
y: { domain: [0, 1], ticks: 8 },
marks: [
Plot.line(pts, { x: "x", y: "y", strokeWidth: 3 }),
Plot.dot(pts, {
fill: "black",
r: 5,
x: "x",
y: "y",
channels: { t: "t" },
tip: true
}),
Plot.frame()
]
});
}