From bdf817efec1cfdd67cc6176a6664442fd98173ae Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Mon, 17 Oct 2022 20:59:01 -0400 Subject: As presented at RUMA on 2022-10-12 --- figs/diamonds.fig/Makefile | 20 +++++++++++++ figs/diamonds.fig/diamonds.py | 65 +++++++++++++++++++++++++++++++++++++++++++ figs/diamonds.fig/shapes.sty | 1 + 3 files changed, 86 insertions(+) create mode 100644 figs/diamonds.fig/Makefile create mode 100644 figs/diamonds.fig/diamonds.py create mode 120000 figs/diamonds.fig/shapes.sty (limited to 'figs/diamonds.fig') diff --git a/figs/diamonds.fig/Makefile b/figs/diamonds.fig/Makefile new file mode 100644 index 0000000..42b4031 --- /dev/null +++ b/figs/diamonds.fig/Makefile @@ -0,0 +1,20 @@ +all: diamonds + +diamonds: + python diamonds.py > diamonds.tikz.tex + cat diamonds.tikz.tex | sed 's/%1%/red/g;s/%2%/blue/g' > diamonds_color.tikz.tex + sed -i 's/%1%/teal/g;s/%2%/teal/g' diamonds.tikz.tex + pdflatex -jobname diamonds diamonds.tikz.tex + pdflatex -jobname diamonds_color diamonds_color.tikz.tex + +clean-aux: + rm -f diamonds.tikz.tex + rm -f diamonds.log + rm -f diamonds.aux + rm -f diamonds_color.tikz.tex + rm -f diamonds_color.log + rm -f diamonds_color.aux + +clean: clean-aux + rm -f diamonds.pdf + rm -f diamonds_color.pdf diff --git a/figs/diamonds.fig/diamonds.py b/figs/diamonds.fig/diamonds.py new file mode 100644 index 0000000..2bc4d9c --- /dev/null +++ b/figs/diamonds.fig/diamonds.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 + +from math import * +import random + +# size of space (must be int) +L=30 +# number of particles +N=int(L*L/2*0.97) + +# check whether two diamonds overlap +def check_overlap(x1,x2): + if(sqrt((x1[0]-x2[0])**2+(x1[1]-x2[1])**2)<=1): + return(True) + return(False) + +# configuration +config=[] + +# put particles on odd lattice manually +for i in range(4): + for j in range(4): + if (i!=2 or j!=1): + config.append([2*int(L/2/2)+1+i+j,2*int(L/2/2)+i-j]) + +# add particles +while len(config)