2 Star 0 Fork 0

AlexWang0296/HyPost

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
RotateCell.py 486 Bytes
一键复制 编辑 原始数据 按行查看 历史
AlexWang0296 提交于 2019-03-21 18:33 +08:00 . debug
# 输出为LAMMPS建模格式
import numpy as np
def rotcell(rotang):
cellvect = [[1, 0], [0, 1]]
rotang = np.deg2rad(rotang)
rotmat = np.array([[np.cos(rotang), -np.sin(rotang)], [np.sin(rotang), np.cos(rotang)]]) # 二维旋转矩阵
cellr = np.dot(rotmat, cellvect) # 对初始晶胞进行旋转
return(cellr)
for u in [1, 5, 10, 15, 16.26, 20, 22.62, 25, 28.07, 30, 35, 36.86, 40, 43.6, 45]:
print(u)
print(rotcell(u/2))
print(rotcell(-u/2))
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/alexwang0296/HyPost.git
[email protected]:alexwang0296/HyPost.git
alexwang0296
HyPost
HyPost
master

搜索帮助