import math


def calculateXRDSnContent_Zach(doubletheta_GeSn):
    """
    Given the double angle of the Ge-Sn peak, return the Sn comp of the Ge-Sn layer
    """
    theta_GeSn = doubletheta_GeSn / 2
    wavelength = 1.5406  # Angstroms

    a_DC_Sn = 6.4892  # Angstroms
    d333_DC_Sn = a_DC_Sn / math.sqrt(27)

    doubletheta_Ge = 90.0571  # degrees
    d333_Ge = wavelength / 2 / math.sin(doubletheta_Ge / 2 * math.pi / 180)  # Angstroms
    d333_GeSn = wavelength / 2 / math.sin(theta_GeSn * math.pi / 180)

    x = (d333_GeSn - d333_Ge) / (d333_DC_Sn - d333_Ge)
    return x * 100