def check_comfort(temperature, moisture, vertices_comfort_area):
    """
    checks if a point of operative temperature and moisture ratio is inside the polygon of comfort defined by its
     vertices, the function only works if the polygon has constant moisture ratio edges

    :param temperature: operative temperature [Â°C]
    :type temperature: list
    :param moisture: moisture ratio [g/kg dry air]
    :type moisture: list
    :param vertices_comfort_area: vertices of operative temperature and moisture ratio ([Â°C],[g/kg dry air])
    :type vertices_comfort_area: list of tuples
    :return: hours of comfort, hours of uncomfort
    :rtype: double, double
    """
    b_low = vertices_comfort_area[0][0]
    m_low = (vertices_comfort_area[3][0] - b_low) / (vertices_comfort_area[
        3][1] - vertices_comfort_area[0][1])
    b_high = vertices_comfort_area[1][0]
    m_high = (vertices_comfort_area[2][0] - b_high) / (vertices_comfort_area
        [2][1] - vertices_comfort_area[1][1])
    count_winter_comfort = 0
    for t, x in zip(temperature, moisture):
        if vertices_comfort_area[0][1] <= x <= vertices_comfort_area[2][1]:
            if m_low * x + b_low <= t <= m_high * x + b_high:
                count_winter_comfort = count_winter_comfort + 1
            else:
                pass
        else:
            pass
    count_winter_uncomfort = len(temperature) - count_winter_comfort
    return count_winter_comfort, count_winter_uncomfort
