lines-intersections.tex 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. \documentclass{article}
  2. \usepackage[pdftex,active,tightpage]{preview}
  3. \setlength\PreviewBorder{2mm}
  4. \usepackage{tkz-fct}
  5. \usetikzlibrary{arrows, decorations.pathreplacing}
  6. \usetikzlibrary{shapes.misc}
  7. \tikzset{
  8. line/.style={
  9. very thick,
  10. black,
  11. to path={% works only with "to" and not "--"
  12. -- (\tikztotarget) node[at start,point] {} node [at end,point] {} \tikztonodes
  13. }
  14. },
  15. point/.style={
  16. thick,
  17. draw=gray,
  18. cross out,
  19. inner sep=0pt,
  20. minimum width=4pt,
  21. minimum height=4pt,
  22. },
  23. }
  24. \begin{document}
  25. \begin{preview}
  26. \begin{tikzpicture}
  27. \draw[white,fill=white] (-1,-1) rectangle (22,8); % background
  28. \tkzInit [xmin=0,xmax=21,ymin=0,ymax=7]
  29. \begin{scriptsize}
  30. \tkzGrid[color = gray!30!white]
  31. \tkzAxeXY
  32. \end{scriptsize}
  33. \draw[line] (1,4) to (6,1);
  34. \draw[line] (2,1) to (5,4);
  35. \draw[line] (3,1) to (6,4);
  36. \draw[line] (4,1) to (8,5);
  37. \draw[line] (3,4) to (9,3);
  38. \draw[line] (7,2) to (9,3);
  39. \draw[line] (6,7) to (9,1);
  40. \draw[line] (11,1) to (16,5);
  41. \draw[line] (13,2) to (14,2);
  42. \draw[line] (14,1) to (14,2);
  43. \draw[line] (14,3) to (15,2);
  44. \draw[line] (15,4) to (15,3);
  45. \draw[line] (13,4) to (13,3);
  46. \draw[line] (17,3) to (21,3);
  47. \draw[line] (19,1) to (19,5);
  48. \end{tikzpicture}
  49. \end{preview}
  50. \end{document}