Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[tikz,border=1cm]{standalone}
- usepackage{printlen}
- uselengthunit{cm}
- newlength{tmpdim}
- begin{document}
- begin{tikzpicture}[x=1cm,y=1cm]
- draw[line width=1pt] (0,0) grid (8,3);
- deflastx{(0,2)}
- defvertA{(1,2),(2,2),(3,2),(4,2),(5,2)}
- foreach x [count=xi from 2,remember=x as lastx, evaluate=x as n1 using {veclen(lastx,x)}] in vertA {
- draw[blue, line width=2pt] lastx -- x node [midway,above] {n1};
- fill[red] x circle (0.1);
- node[red,below] at x {xi};
- }
- end{tikzpicture}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement