Drawing continuous modular line in tikz

tikz-pgf

I have a one dimensional vector space V=span{(1,\sqrt 2)} and I want to draw its image mod 1 under a matrix A. Is there a way to draw continuously (unlike this question here) the line beginning in (0,0), passing through (1,\sqrt(2)-1) and so on?

Roughly speaking that should look like this (modulu my slopy hands):

enter image description here

Best Answer

\documentclass[border=9,tikz]{standalone}

\begin{document}

\tikz{
    \clip(0,0)rectangle(10,10);
    \foreach\x in{0,...,10}{
        \foreach\y in{0,...,20}{
            \draw(-\x0,-\y0)--+(100,141.421);
        }
    }
}

\end{document}

slope √2 line mod 1

A proof that this works

\tikz{
    \clip(0,0)rectangle(10,10);
    \foreach\x in{0,...,3}{
        \foreach\y in{0,...,10}{
            \draw(-\x0,-\y0)--+(100,141.421);
        }
    }
    \foreach\x in{1,...,5}{
        \draw[blue,dotted]({mod(7.07106*\x,10)},0)--+(0,10);
    }
    \foreach\x in{1,...,3}{
        \draw[red,dotted](0,{mod(4.14213*\x,10)})--+(10,0);
    }
}

slope √2 line mod 1 with tracking help

An animation that shows how line grow

\foreach\frame in{0,...,40}{
    \tikz{
        \clip(0,0)rectangle(10,10);
        \foreach\x in{-5,...,5}{
            \foreach\y in{-8,...,8}{
                \fill[shift={(\x0,\y0)},scale=\frame/10]
                    (-.2,.2)--(10,14.1421)--
                    (.2,-.2)--(-10,-14.1421)--cycle;
            }
        }
    }
}

a growing "line" that wraps

Bonus

growing black line and then white line