+
+ if (i > 0) {
+ const last = positions[i - 1];
+
+ if (config.lines) {
+ const [lx, ly] = coordinateToScreen(last[0], last[1]);
+
+ ctx.beginPath();
+ ctx.moveTo(lx, ly);
+ ctx.lineTo(x, y);
+ ctx.strokeStyle = "red";
+ ctx.stroke();
+ }
+
+ if (config.circles) {
+ const [cx, cy] = coordinateToScreen((pos[0] + last[0]) / 2, (pos[1] + last[1]) / 2);
+
+ ctx.beginPath();
+ ctx.arc(cx, cy, scale * Math.sqrt(Math.pow(pos[0] - last[0], 2) + Math.pow(pos[1] - last[1], 2)) / 2, 0, Math.PI * 2);
+ ctx.strokeStyle = "green";
+ ctx.stroke();
+ }
+ }