From 618f6b678a3782a43d8015350da01c5c73b8547d Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Sat, 5 May 2018 23:18:02 +0000 Subject: Initial commit --- figs/atoms.fig/crystal.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 figs/atoms.fig/crystal.py (limited to 'figs/atoms.fig/crystal.py') diff --git a/figs/atoms.fig/crystal.py b/figs/atoms.fig/crystal.py new file mode 100644 index 0000000..1fe03e2 --- /dev/null +++ b/figs/atoms.fig/crystal.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +from math import * +import random +import sys + +# number of Cl atoms +N=5 + +for i in range(N): + for j in range(N): + for k in range(N): + if ((i+j+k)%2==0): + color=1 + size=1 + else: + color=0 + size=0.5 + print("'++' u", end=" ") + print("("+str(1.5*i)+"+("+str(size)+")*cos($1)*sin($2))", end=":") + print("("+str(1.5*j)+"+("+str(size)+")*sin($1)*sin($2))", end=":") + print("("+str(1.5*k)+"+("+str(size)+")*cos($2))", end=":") + print("("+str(color)+")", end=" ") + print("with pm3d", end="") + if i