def is_inside(atom, ext):
    """Check (bool) if an atom is inside the given extents.
    
    ext -- 3x2 array of (x,y,z) and min/max, respectively"""
    return atom.x >= ext[0,0] and \
            atom.x <= ext[0,1] and \
            atom.y >= ext[1,0] and \
            atom.y <= ext[1,1] and \
            atom.z >= ext[2,0] and \
            atom.z <= ext[2,1]