, eq[2]);
        var yi = projected_y(x, y, eq[0], eq[1], eq[2]);
        var distancei = length_of(x - xi, y - yi);
        if (distancei < closest_distance) {
            closest_distance = distancei;
            closest_eq_i = i;
        }
    }
    return closest_eq_i + 1;
}
    
function invalidate_plot_named(name) {
    var temp_id = eval(name + "_eq_temp_id");
    eval(name + "_eq_" + temp_id + " = Array.from(" + name + "_eq_" + temp_id + "_temp);");
    draw_plot_named(name, 0, 0, false);
    updat