\section{Length contraction and time dilation}

Up to now, we've been considering everything as points. We haven't considered how tall or wide you are when drawing these diagrams. Now we are going to.

\problem{}
    Draw a stick of length $1$ at rest in a spacetime diagram.

    \begin{solution}\begin{center}\begin{tikzpicture}[scale=2.0]
      \message{Worldlines^^J}
      
      \def\ymin{0.2}
      \def\xmin{1.6}
      \def\xmax{2}
      \def\Nlines{4} % number of world lines (at constant x/t)
      \pgfmathsetmacro\d{0.9*\xmax/\Nlines} % grid size
      \coordinate (O) at (0,0);
      \coordinate (T) at (0,\xmax+0.2);
      
      % WORLD LINES GRID
      \message{  Making world lines...^^J}
      \foreach \i [evaluate={\x=\i*\d;}] in {1,...,\Nlines}{
        \message{  Running i/N=\i/\Nlines, x=\x...^^J}
        \draw[world line]   ( \x,-\ymin) -- ( \x,\xmax);
        \draw[world line t] (-\xmin, \x) -- (\xmax, \x);
      }
      \draw[world line] (-\d,-\ymin) -- (-\d,\xmax);
      \draw[world line] (-2*\d,-\ymin) -- (-2*\d,\xmax);
      \draw[world line] (-3*\d,-\ymin) -- (-3*\d,\xmax);
      
      % AXES
      \draw[->,thick] (0,-\ymin) -- (T) node[left=-1] {$ct$};
      \draw[->,thick] (-\xmin,0) -- (\xmax+0.2,0) node[below=0] {$x$};
      
      % VECTORS
      \draw[vector,myred] (O) -- (0,4*\d)
        node[mydarkred,below left=0] {\contour{white}{stick: $x(t)=0$}};
      \draw[vector,myred] (\d,0) -- (\d,4*\d);
      %\node[right=8,above,mydarkpurple] at (T) {$x(t)=0$};

      \fill[myred,opacity=1]
        (0,0) -- (0,4*\d) -- (\d,4*\d) -- (\d,0) -- cycle;
      \end{tikzpicture}\end{center}\end{solution}

\problem{}
    Draw a stick of length $1$ sitting on a train moving at speed $c/2$.

    {\em Hint: Begin by drawing the train's reference frame.}

    \begin{solution}\begin{center}\begin{tikzpicture}[scale=2.0]
      \message{Worldlines^^J}
      
      \pgfmathsetmacro\ang{atan(1/2)} % angle between x and x' axes
      \def\ymin{0.2}
      \def\xmin{1.6}
      \def\xmax{2}
      \def\xmaxp{2.2} % maximum of rotated axis
      \def\Nlines{4} % number of world lines (at constant x/t)
      \pgfmathsetmacro\d{0.9*\xmax/\Nlines} % grid size
      \coordinate (O) at (0,0);
      \coordinate (T) at (0,\xmax+0.2);

        \def\xmax{2}
        \def\xmaxp{2.2} % maximum of rotated axis
        \def\Nlines{5} % number of world lines (at constant x/t)
        \pgfmathsetmacro\ang{atan(1/2)} % angle between x and x' axes
        \pgfmathsetmacro\d{0.9*\xmax/\Nlines}refer % grid size
        \pgfmathsetmacro\D{\d/cos(\ang)/sqrt(1-tan(\ang)^2)} % grid size, boosted
        \coordinate (O) at (0,0);
        \coordinate (X) at (\xmax+0.2,0);
        \coordinate (T) at (0,\xmax+0.2);
        \coordinate (X') at (\ang:\xmaxp+0.2);
        \coordinate (T') at (90-\ang:\xmaxp+0.2);
      
      % WORLD LINES GRID
      \message{  Making world lines...^^J}
      \foreach \i [evaluate={\x=\i*\d;}] in {1,...,\Nlines}{
        \message{  Running i/N=\i/\Nlines, x=\x...^^J}
        \draw[world line]   ( \x,-\ymin) -- ( \x,\xmax);
        \draw[world line t] (-\xmin, \x) -- (\xmax, \x);
      }
      \draw[world line] (-\d,-\ymin) -- (-\d,\xmax);
      \draw[world line] (-2*\d,-\ymin) -- (-2*\d,\xmax);
      \draw[world line] (-3*\d,-\ymin) -- (-3*\d,\xmax);
      \draw[vector,mydarkred] (O) -- (\ang:\xmaxp)
        node[mydarkred,right=0] {\contour{white}{$x'$}};
      \draw[vector,mydarkred] (O) -- (90-\ang:\xmaxp)
      node[mydarkred,left=0] {\contour{white}{$ct'$}};
      
      
      
      % AXES
      \draw[->,thick] (0,-\ymin) -- (T) node[left=-1] {$ct$};
      \draw[->,thick] (-\xmin,0) -- (\xmax+0.2,0) node[below=0] {$x$};
      % BOOSTED WORLD LINE GRID
      \message{  Making world lines for boosted frame...^^J}
      \fill[mydarkred,opacity=0.05]
        (O) --++ (\ang:\xmaxp) --++ (90-\ang:\xmaxp) --++ (\ang:-\xmaxp) -- cycle;
      % \fill[mydarkred,opacity=0.05]
      %   (O) --++ (\ang:-\xmaxp) --++ (90-\ang:-\xmaxp) --++ (\ang:\xmaxp) -- cycle;
      
      \foreach \i [evaluate={\x=\i*\D;}] in {1,...,4}{
        \message{  Running i/N=\i/\Nlines, x=\x...^^J}
        % \draw[world line'] (\ang:-\x) --++ (90-\ang:-\xmaxp);
        % \draw[world line'] (90-\ang:-\x) --++ (\ang:-\xmaxp);
        \draw[world line'] (\ang:\x) --++ (90-\ang:\xmaxp);
        \draw[world line'] (90-\ang:\x) --++ (\ang:\xmaxp);
      }

      \fill[myred,opacity=1]
        (O) --++ (\ang:\D) --++ (90-\ang:\xmaxp) --++ (\ang:-\D) -- cycle;
  \end{tikzpicture}\end{center}\end{solution}

  \problem{}
    In the rest frame, what is the length of the stick? This should require only some simple trigonometry.

    {\em Hint: pick a particular time in the rest frame and look at where the stick is at that particular time.}

    Generalize this to a general reference frame moving at speed $ck$.

    Suppose that the stick has a length $\ell'$ in the reference frame of the train moving at speed $ck$. What is the length, $\ell$, of the stick in the rest frame?

    Physically, what does this mean? What happens to the stick as it moves faster?
    
    \begin{solution}
        $\ell$ is the length of the stick on the ground, $\ell'$ is the length of the stick on the train. For a speed of $ck$, the $x'$ axis has a slope of $k$. We then calculate
        \begin{align*}
            \ell^2 + k^2 \ell^2  & = (\ell')^2\\
            \ell  & = \frac{\ell'}{\sqrt{1 + k^2}}\\
        \end{align*}
    \end{solution}

\problem{}
    Now suppose that you measure out $t'$ seconds of time on the train which is moving at a speed of $kc$. When you start your clock, you yell "START" and when you stop your clock, you yell "STOP". How long between the two yells would someone at rest measure? What does this imply physically?

    \begin{solution}
        Let $t'$ be the seconds on the train and $t$ be the seconds in the rest frame. The same calculation as the length contraction implies that
        \begin{align*}
            (ct)^2 + (ckt)^2 & = (ct')^2 \\
            t & = \frac{t'}{\sqrt{1 + k^2}} \\
        \end{align*}
    \end{solution}