pymatgen
pymatgen copied to clipboard
Wrong equation in analysis/diffraction/tem.py get_interplanar_angle
Describe the bug In the function get_interplnar_angle of module analysis/diffraction/tem.py, there are some typos that are circled in the attached screenshot and should be corrected as below.
To Reproduce
- r1_norm = np.sqrt( p1[0] ** 2 * a_star2 + p1[1] ** 2 * b_star2 + p1[2] ** 2 * c_star**2 + 2 * p1[0] * p1[1] * a_star * b_star * cos_gamma_star + 2 * p1[0] * p1[2] * a_star * c_star * cos_beta_star + 2 * p1[1] * p1[2] * b_star * c_star * cos_alpha_star )
- r2_norm = np.sqrt( p2[0] ** 2 * a_star2 + p2[1] ** 2 * b_star2 + p2[2] ** 2 * c_star**2 + 2 * p2[0] * p2[1] * a_star * b_star * cos_gamma_star + 2 * p2[0] * p2[2] * a_star * c_star * cos_beta_star + 2 * p2[1] * p2[2] * b_star * c_star * cos_alpha_star )
- r1_dot_r2 = ( p1[0] * p2[0] * a_star2 + p1[1] * p2[1] * b_star2 + p1[2] * p2[2] * c_star**2 + (p1[0] * p2[1] + p2[0] * p1[1]) * a_star * b_star * cos_gamma_star + (p1[0] * p2[2] + p2[0] * p1[2]) * a_star * c_star * cos_beta_star + (p1[1] * p2[2] + p2[1] * p1[2]) * b_star * c_star * cos_alpha_star )
Screenshots Attached below.
Desktop (please complete the following information):
- OS: (e.g. Mac)
- Version (e.g. 2020.07)

@mkhorton Pls assign to Jason or Frank.
Tagging @welltemperedpaprika and @thefrankwan as original authors of this module.
@EurusWei, since you have suggested a fix, you are also welcome to submit a brief PR with your suggested change.