def get_coordinates_array(xyz):
    """
    Given xyz string, return natom*3 array that contains the
    coordinates of the atoms.
    """
    lines = xyz.splitlines()
    n = int(lines[0])
    coords = [0.]*(n*3)
    i = 0
    for line in lines[2:2+n]:
        coords[i:i+3] = [float(c) for c in line.split()[1:4]]
        i += 3
    return coords