function generatePoints(n, maxValue = 100) {
let points = [];
for (let i = 0; i < n; i++) {
let x = i;
let y = Math.random() * maxValue;
if (i == 0 || i == n-1) {
points.push({ x: x, y: maxValue / 2 });
} else {
points.push({ x: x, y: y });
}
}
return points;
}