% square lattice (width #1, height #2, origin #3)
\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);
  }
}
