import math


def printAtom(atom, alchemical=False):
    """Generate atom line

    Parameters
    ----------
    atom : Atom class
        Atom object
    alchemical : bool, optional
        If alchemical data, by default False

    Returns
    -------
    atomLine : str
        Atom line data
    """

    if alchemical:

        lj_A = 2.0*(atom.sigma_B**6)*math.sqrt(atom.epsilon_B)
        lj_B = 2.0*(atom.sigma_B**3)*math.sqrt(atom.epsilon_B)

        type_q = atom.type_q_B
        mass = atom.mass_B
        
    else:

        lj_A = 2.0*(atom.sigma**6)*math.sqrt(atom.epsilon)
        lj_B = 2.0*(atom.sigma**3)*math.sqrt(atom.epsilon)
        

        type_q = atom.type_q
        mass = atom.mass


    return '%-5s%12.4f %12.4f %12.4f %12.4f %12.4f %12.4f ! %5s\n' % (type_q, 
            lj_A, lj_A, lj_B, lj_A/math.sqrt(2.0), lj_B/math.sqrt(2.0), mass, atom.resname)