def _line_y(line, x):
    """Return the y value at which the `line` crosses the vertical line at `x`."""
    p1 = line[0]
    p2 = line[1]
    if p2[0] == p1[0]:
        if p1[0] == x:
            return p1[1]
        return None
    m = (p2[1] - p1[1]) / (p2[0] - p1[0])
    y = p1[1] + m * (x - p1[0])
    return y