intersecting-lines-1.tex 1019 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. \documentclass{article}
  2. \usepackage[pdftex,active,tightpage]{preview}
  3. \setlength\PreviewBorder{0mm}
  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. ultra 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] (-0.5,-0.5) rectangle (7.2,5.2); % background
  28. \tkzInit [xmin=0,xmax=6.5,ymin=0,ymax=4.5]
  29. \begin{scriptsize}
  30. \tkzGrid[color = gray!30!white]
  31. \tkzAxeXY
  32. \end{scriptsize}
  33. \draw[line,red] (2,1) to (5,4);
  34. \draw[line,blue] (1,4) to (6,1);
  35. \end{tikzpicture}
  36. \end{preview}
  37. \end{document}