Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jauslin <jauslin@ias.edu>2018-02-06 19:57:42 +0000
committerIan Jauslin <jauslin@ias.edu>2018-02-06 19:57:42 +0000
commitbfed53d2c76cc0449d2d6ef1963863092fb98d03 (patch)
treef9ab1f9e84474684dcdaa37b8a0743c4fa93c1b6 /figs/atoms.fig/crystal.py
As presented at Princeton University on 2018-02-06HEADv1.0master
Diffstat (limited to 'figs/atoms.fig/crystal.py')
-rw-r--r--figs/atoms.fig/crystal.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/figs/atoms.fig/crystal.py b/figs/atoms.fig/crystal.py
new file mode 100644
index 0000000..4b1ba3c
--- /dev/null
+++ b/figs/atoms.fig/crystal.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python3
+
+from math import *
+import random
+import sys
+
+# size of lattice
+N=5
+
+# configuration
+config=[]
+for i in range(N):
+ for j in range(N):
+ for k in range(N):
+ config.append([2*i+((j+k)%2),sqrt(3)*(j+(k%2)/3),2*sqrt(6)/3*k])
+
+
+for i in range(len(config)):
+ print(str(config[i][0])+"+cos(u)*sin(v)", end=",")
+ print(str(config[i][1])+"+sin(u)*sin(v)", end=",")
+ print(str(config[i][2])+"+cos(v)", end=" ")
+ print("with pm3d", end="")
+ if i<len(config)-1:
+ print(", \\")