def get_angles( lattice ):
"""
Get alpha, beta and gamma angles from lattice vectors.
>>> get_angles( np.diag([1,2,3]) )
(90.0, 90.0, 90.0)
"""
a, b, c = get_cell_parameters( lattice )
alpha = np.arccos(np.vdot(lattice[1], lattice[2]) / b / c ) / np.pi * 180
beta = np.arccos(np.vdot(lattice[2], lattice[0]) / c / a ) / np.pi * 180
gamma = np.arccos(np.vdot(lattice[0], lattice[1]) / a / b ) / np.pi * 180
return alpha, beta, gamma
评论列表
文章目录