import random


def crd(a, p, b, d):
    """ Returns atomic coordinate using given alat, place, basis atom coordinate and
    maximum random distortion value
    In:
     -> a - lattice constant
     -> p - cell number in a supercell
     -> b - basis coordinate
     -> d - maximum random distortion (in fractions of lattice constant)
    Out:
     -> crd - an atomic coordinate (float)
    """
    return a*(p+b+random.uniform(-d,d))