Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. documentclass[tikz,border=1cm]{standalone}
  2.  
  3. usepackage{printlen}
  4. uselengthunit{cm}
  5. newlength{tmpdim}
  6.  
  7. begin{document}
  8. begin{tikzpicture}[x=1cm,y=1cm]
  9. draw[line width=1pt] (0,0) grid (8,3);
  10.  
  11. deflastx{(0,2)}
  12. defvertA{(1,2),(2,2),(3,2),(4,2),(5,2)}
  13.  
  14. foreach x [count=xi from 2,remember=x as lastx, evaluate=x as n1 using {veclen(lastx,x)}] in vertA {
  15. draw[blue, line width=2pt] lastx -- x node [midway,above] {n1};
  16. fill[red] x circle (0.1);
  17. node[red,below] at x {xi};
  18. }
  19. end{tikzpicture}
  20.  
  21. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement