from cresset import flare
用鼠标单击,选中两个原子,创建向量v1:
atoms = flare.main_window().picked_atoms
import numpy as np
v1 = np.array(atoms[0].pos)-np.array(atoms[1].pos)
用鼠标单击,选中另两个原子,创建向量v2:
atoms = flare.main_window().picked_atoms
v2 = np.array(atoms[0].pos)-np.array(atoms[1].pos)
求平面的法线n与法向量n0:
n = np.cross(v1,v2)
n0 = n/np.linalg.norm(n)
求法线上距离M点1Å的点p1与p2,就是我想要的点N,也就是计算NICS(1)用到的虚原子坐标
c0 = (0.41699999, 64.70199903, 84.9350001)
c0 = np.array(c0)
p1 = c0 - n0
p2 = c0 + n0
打印出坐标
print("NICS(1):",p1)
print("NICS(1):",p2)
NICS(1): [ 1.15640274 64.02874937 84.93070186] NICS(1): [-0.32240276 65.37524869 84.93929834]