{
const context = DOM.context2d(width, width);
context.translate(width / 2, width / 2);
let angle = 0;
const trace = [];
yield context.canvas;
while (true) {
await Promises.delay(50);
context.clearRect(-width / 2, -width / 2, width, width);
const p1 = [x1 * (width / 2), y1 * (width / 2), 3];
circle(p1, context);
const l1 = lineThrough(p1, angle, context);
const p2 = [0.5 * (width / 2), -0.3 * (width / 2), 3];
circle(p2, context);
const l2 = lineThrough(p2, -angle, context);
const intersection = intersectionLL(l1, l2);
if (intersection) {
circle([...intersection, 3], context, { color: "red" });
trace.push(intersection);
}
if (trace.length > 150) trace.shift();
for (let p of trace) {
circle([...p, 3], context, { color: "red" });
}
angle = (angle + 1) % 360;
}
}