17 lines
554 B
TeX
17 lines
554 B
TeX
% square lattice (width #1, height #2, origin #3, spacing #4)
|
|
\def\grid#1#2#3{
|
|
\foreach\i in {0,...,#2}{
|
|
\draw#3++(0,\i)--++(#1,0);
|
|
}
|
|
\foreach\i in {0,...,#1}{
|
|
\draw#3++(\i,0)--++(0,#2);
|
|
}
|
|
}
|
|
|
|
|
|
% cross (color #1, position #2)
|
|
\def\cross#1#2{
|
|
\fill[color=#1]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-1)--++(-1,0)--++(0,-1)--++(1,0)--++(0,-1)--++(1,0)--++(0,1)--++(1,0)--++(0,1)--++(-1,0);
|
|
\draw[color=black]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-1)--++(-1,0)--++(0,-1)--++(1,0)--++(0,-1)--++(1,0)--++(0,1)--++(1,0)--++(0,1)--++(-1,0);
|
|
}
|