Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. documentclass[tikz,border=3.14mm]{standalone}
  2. usetikzlibrary{matrix}
  3. begin{document}
  4. begin{tikzpicture}
  5. edeflstadd{{0,16,-12}}
  6. edeflstsub{{-4,0,6}}
  7. matrix[matrix of math nodes,nodes={text width=1.5em}] (mat)
  8. {
  9. 0 & 2 & 1 & 0 & 2 \
  10. 3 & -1 & 2 & 3 & -1\
  11. 4 & -4 & 1 & 4 & -4\
  12. };
  13. foreach X [evaluate=X as Y using {int(X+2)}]in {1,2,3}
  14. {pgfmathtruncatemacro{mylabel}{lstadd[X-1]}
  15. draw[purple,-latex,thick] (mat-1-X.north west) -- (mat-3-Y.south east)
  16. node[pos=1.1]{mylabel};
  17. pgfmathtruncatemacro{mylabel}{lstsub[X-1]}
  18. draw[purple,-latex,thick] (mat-3-X.south west) -- (mat-1-Y.north east)
  19. node[pos=1.1]{mylabel};
  20. }
  21. end{tikzpicture}
  22. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement