From 7629eb82cc5e05ef514912d9f393d0f42feb8c93 Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Thu, 26 Oct 2017 20:02:17 +0000 Subject: As presented at Rutgers University on 2017-10-26 --- figs/atoms.fig/crystal.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 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..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