Skip to content

Instantly share code, notes, and snippets.

@yury
Created August 19, 2009 16:41
Show Gist options
  • Save yury/170447 to your computer and use it in GitHub Desktop.
Save yury/170447 to your computer and use it in GitHub Desktop.
points = [[0,0],[4,2],[3,3],[2,4],[6,6],[8,3]] # это как раз твои точки из exact
x_min_max = points.minmax { |a, b| a[0] <=> b[0] }
y_min_max = points.minmax { |a, b| a[1] <=> b[1] } # тут была ошибка
left_bottom_point = [x_min_max[0][0], y_min_max[0][1]]
top_right_point = [x_min_max[1][0], y_min_max[1][1]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment