# -*- coding: utf-8 -*-

__author__ = "Zasimov Alexey"
__email__ = "zasimov-a@yandex-team.ru"


X = 0
Y = 1


def projection_2d(axis, plot):
    """
    >>> projection_2d(X, [(1,1), (2,1), (3,1)])
    [1, 2, 3]
    >>> projection_2d(Y, [(1,1), (2,1), (3,1)])
    [1, 1, 1]
    """
    return list([p[axis] for p in plot])


def min_2d(axis, plot):
    return min(projection_2d(axis, plot))


def max_2d(axis, plot):
    return max(projection_2d(axis, plot))
