Added angle calculation and edge intersection check, sorted points in visible_vertices