(xy[1]-points[0][1]), 2);
	for(var i = 1; i < points.length; ++i) {
		const d = Math.pow((xy[0]-points[i][0]), 2) + Math.pow((xy[1]-points[i][1]), 2);
		if(d < best_d) {
			best_d = d;
			best_i = i;
		}
	}
	return best_i;
}

function init_atan_plot(i_canvas, i_fs, i_colors, i_verticals, i_x, i_y, i_scale, i_w, i_h, i_do_side_panel, i_do_cross, i_do_timed_sync) {
	const w = i_w;
	const h = i_h;
	const x_value = i_x;
	const y_value = i_y;
	const scale_value = i_scale;
	i_canvas.width = w;
	i_canvas.height = 