import math


def ComputeDistAtom(dAtom1, dAtom2):
    """Compute the distance between two atoms.
    Input: dAtom1, dAtom2 which are dico corresponding to atom 1 and atom 2 respectively.
           For instance dAtom = dPDB[resnumber][atom].
    Output: distance (float)
    """

    coord1 = [dAtom1["x"], dAtom1["y"], dAtom1["z"]]
    coord2 = [dAtom2["x"], dAtom2["y"], dAtom2["z"]]

    dist = math.sqrt(
        (coord1[0] - coord2[0]) ** 2
        + (coord1[1] - coord2[1]) ** 2
        + (coord1[2] - coord2[2]) ** 2
    )

    return float(dist)