MA0001/Exercise 2/figures/3a.tex

27 lines
1.1 KiB
TeX

\begin{tikzpicture}
% Frame
\draw [thick, <->] (0,-4) -- (0,0) -- (9,0);
% Vertical lines
\draw (3,0) node[anchor=south] {1.1} -- (3,-4) ;
\draw (6,0) node[anchor=south] {4.5} -- (6,-4) ;
% Upper horizontal lines
\draw [dashed] (0,-1) node [anchor=east] {$|4.5-c|$} -- (3,-1) node [midway, above, sloped] {$-c$} -- (6,-1);
\draw [dashed] (0,-2) node [anchor=east] {$|c-1.1|$} -- (3,-2) node [midway, above, sloped] {$-c$};
\draw (6,-1) -- (9,-1) node [midway, above, sloped] {$c$};
\draw (3,-2) --(6,-2) node [midway, above, sloped] {$c$} -- (9,-2) ;
% Points
\node[circle,fill,inner sep=1.5pt] at (6,-1) {};
\node[circle,fill,inner sep=1.5pt] at (3,-2) {};
\node[circle,fill,inner sep=1.5pt] at (3,-3) {};
\node[circle,fill,inner sep=1.5pt] at (6,-3) {};
% Lower horizontal line
\draw [dashed] (0,-3) node [anchor=east] {$|4.5-c| + |c-1.1|$} -- (3,-3) node [midway, above, sloped] {$-2c$};
\draw (3,-3) -- (6,-3) node [midway, above, sloped] {$0$};
\draw (6,-3) -- (9,-3) node [midway, above, sloped] {$2c$};
\end{tikzpicture}