From 9134d13eace9780f0f82e69b76c477830d20b244 Mon Sep 17 00:00:00 2001 From: Martin Thoma Date: Fri, 18 Jan 2013 09:45:44 +0100 Subject: [PATCH] added interstection examples --- tikz/bounding-box-lines-1/Makefile | 31 +++++++++++ .../bounding-box-lines-1.tex | 45 +++++++++++++++ tikz/bounding-box-lines-2/Makefile | 31 +++++++++++ .../bounding-box-lines-2.tex | 43 +++++++++++++++ tikz/bounding-box-lines-3/Makefile | 31 +++++++++++ .../bounding-box-lines-3.tex | 44 +++++++++++++++ tikz/bounding-box-lines-4/Makefile | 31 +++++++++++ .../bounding-box-lines-4.tex | 44 +++++++++++++++ tikz/intersecting-lines-1/Makefile | 31 +++++++++++ .../intersecting-lines-1.tex | 40 ++++++++++++++ tikz/intersecting-lines-2/Makefile | 31 +++++++++++ .../intersecting-lines-2.tex | 40 ++++++++++++++ tikz/intersecting-lines-3/Makefile | 31 +++++++++++ .../intersecting-lines-3.tex | 40 ++++++++++++++ tikz/intersecting-lines-4/Makefile | 31 +++++++++++ .../intersecting-lines-4.tex | 40 ++++++++++++++ tikz/intersecting-lines-5/Makefile | 31 +++++++++++ .../intersecting-lines-5.tex | 47 ++++++++++++++++ tikz/lines-intersections/Makefile | 31 +++++++++++ .../lines-intersections.tex | 55 +++++++++++++++++++ 20 files changed, 748 insertions(+) create mode 100644 tikz/bounding-box-lines-1/Makefile create mode 100644 tikz/bounding-box-lines-1/bounding-box-lines-1.tex create mode 100644 tikz/bounding-box-lines-2/Makefile create mode 100644 tikz/bounding-box-lines-2/bounding-box-lines-2.tex create mode 100644 tikz/bounding-box-lines-3/Makefile create mode 100644 tikz/bounding-box-lines-3/bounding-box-lines-3.tex create mode 100644 tikz/bounding-box-lines-4/Makefile create mode 100644 tikz/bounding-box-lines-4/bounding-box-lines-4.tex create mode 100644 tikz/intersecting-lines-1/Makefile create mode 100644 tikz/intersecting-lines-1/intersecting-lines-1.tex create mode 100644 tikz/intersecting-lines-2/Makefile create mode 100644 tikz/intersecting-lines-2/intersecting-lines-2.tex create mode 100644 tikz/intersecting-lines-3/Makefile create mode 100644 tikz/intersecting-lines-3/intersecting-lines-3.tex create mode 100644 tikz/intersecting-lines-4/Makefile create mode 100644 tikz/intersecting-lines-4/intersecting-lines-4.tex create mode 100644 tikz/intersecting-lines-5/Makefile create mode 100644 tikz/intersecting-lines-5/intersecting-lines-5.tex create mode 100644 tikz/lines-intersections/Makefile create mode 100644 tikz/lines-intersections/lines-intersections.tex diff --git a/tikz/bounding-box-lines-1/Makefile b/tikz/bounding-box-lines-1/Makefile new file mode 100644 index 0000000..be27e6c --- /dev/null +++ b/tikz/bounding-box-lines-1/Makefile @@ -0,0 +1,31 @@ +SOURCE = bounding-box-lines-1 +DELAY = 80 +DENSITY = 300 +WIDTH = 500 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot + +gif: + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif + make clean + +png: + make + make svg + inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png + +transparentGif: + convert $(SOURCE).pdf -transparent white result.gif + make clean + +svg: + #inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg + pdf2svg $(SOURCE).pdf $(SOURCE).svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg diff --git a/tikz/bounding-box-lines-1/bounding-box-lines-1.tex b/tikz/bounding-box-lines-1/bounding-box-lines-1.tex new file mode 100644 index 0000000..53b0921 --- /dev/null +++ b/tikz/bounding-box-lines-1/bounding-box-lines-1.tex @@ -0,0 +1,45 @@ +\documentclass{article} +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{0mm} + +\usepackage{tkz-fct} +\usetikzlibrary{arrows, decorations.pathreplacing} +\usetikzlibrary{shapes.misc} + +\tikzset{ + line/.style={ + very thick, + black, + to path={% works only with "to" and not "--" + -- (\tikztotarget) node[at start,point] {} node [at end,point] {} \tikztonodes + } + }, + point/.style={ + ultra thick, + draw=gray, + cross out, + inner sep=0pt, + minimum width=4pt, + minimum height=4pt, + }, +} + +\begin{document} +\begin{preview} +\begin{tikzpicture} + + \draw[white,fill=white] (-0.5,-0.5) rectangle (7.2,5.2); % background + \draw[blue!15,fill=blue!15,ultra thick] (1,4) rectangle (6,1); % bounding box + \draw[red!15,fill=red!15] (1,1) rectangle (4,4); % bounding box + \tkzInit [xmin=0,xmax=6.5,ymin=0,ymax=4.5] + \begin{scriptsize} + \tkzGrid[color = gray!30!white] + \tkzAxeXY + \end{scriptsize} + + \draw[line,red] (1,1) to (4,4); + + \draw[line,blue] (1,4) to (6,1); +\end{tikzpicture} +\end{preview} +\end{document} diff --git a/tikz/bounding-box-lines-2/Makefile b/tikz/bounding-box-lines-2/Makefile new file mode 100644 index 0000000..c4eed7f --- /dev/null +++ b/tikz/bounding-box-lines-2/Makefile @@ -0,0 +1,31 @@ +SOURCE = bounding-box-lines-2 +DELAY = 80 +DENSITY = 300 +WIDTH = 500 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot + +gif: + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif + make clean + +png: + make + make svg + inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png + +transparentGif: + convert $(SOURCE).pdf -transparent white result.gif + make clean + +svg: + #inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg + pdf2svg $(SOURCE).pdf $(SOURCE).svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg diff --git a/tikz/bounding-box-lines-2/bounding-box-lines-2.tex b/tikz/bounding-box-lines-2/bounding-box-lines-2.tex new file mode 100644 index 0000000..2588257 --- /dev/null +++ b/tikz/bounding-box-lines-2/bounding-box-lines-2.tex @@ -0,0 +1,43 @@ +\documentclass{article} +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{0mm} + +\usepackage{tkz-fct} +\usetikzlibrary{arrows, decorations.pathreplacing} +\usetikzlibrary{shapes.misc} + +\tikzset{ + line/.style={ + very thick, + black, + to path={% works only with "to" and not "--" + -- (\tikztotarget) node[at start,point] {} node [at end,point] {} \tikztonodes + } + }, + point/.style={ + ultra thick, + draw=gray, + cross out, + inner sep=0pt, + minimum width=4pt, + minimum height=4pt, + }, +} + +\begin{document} +\begin{preview} +\begin{tikzpicture} + \draw[white,fill=white] (-0.5,-0.5) rectangle (6.2,5.2); % background + \draw[red!15,fill=red!15] (1,1) rectangle (4,4); % bounding box + \draw[blue!15,fill=blue!15] (2,2) rectangle (3,3); % bounding box + \tkzInit [xmin=0,xmax=4.5,ymin=0,ymax=4.5] + \begin{scriptsize} + \tkzGrid[color = gray!30!white] + \tkzAxeXY + \end{scriptsize} + + \draw[line,red] (1,1) to (4,4); + \draw[line,blue] (2,2) to (3,3); +\end{tikzpicture} +\end{preview} +\end{document} diff --git a/tikz/bounding-box-lines-3/Makefile b/tikz/bounding-box-lines-3/Makefile new file mode 100644 index 0000000..604145b --- /dev/null +++ b/tikz/bounding-box-lines-3/Makefile @@ -0,0 +1,31 @@ +SOURCE = bounding-box-lines-3 +DELAY = 80 +DENSITY = 300 +WIDTH = 500 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot + +gif: + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif + make clean + +png: + make + make svg + inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png + +transparentGif: + convert $(SOURCE).pdf -transparent white result.gif + make clean + +svg: + #inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg + pdf2svg $(SOURCE).pdf $(SOURCE).svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg diff --git a/tikz/bounding-box-lines-3/bounding-box-lines-3.tex b/tikz/bounding-box-lines-3/bounding-box-lines-3.tex new file mode 100644 index 0000000..cc9558e --- /dev/null +++ b/tikz/bounding-box-lines-3/bounding-box-lines-3.tex @@ -0,0 +1,44 @@ +\documentclass{article} +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{0mm} + +\usepackage{tkz-fct} +\usetikzlibrary{arrows, decorations.pathreplacing} +\usetikzlibrary{shapes.misc} + +\tikzset{ + line/.style={ + very thick, + black, + to path={% works only with "to" and not "--" + -- (\tikztotarget) node[at start,point] {} node [at end,point] {} \tikztonodes + } + }, + point/.style={ + ultra thick, + draw=gray, + cross out, + inner sep=0pt, + minimum width=4pt, + minimum height=4pt, + }, +} + +\begin{document} +\begin{preview} +\begin{tikzpicture} + + \draw[white,fill=white] (-0.5,-0.5) rectangle (7.2,5.2); % background + \draw[red!15,fill=red!15] (1,4) rectangle (4,2); % bounding box + \draw[blue!15,fill=blue!15] (2,1) rectangle (4,2); % bounding box + \tkzInit [xmin=0,xmax=6.5,ymin=0,ymax=4.5] + \begin{scriptsize} + \tkzGrid[color = gray!30!white] + \tkzAxeXY + \end{scriptsize} + + \draw[line,red] (2,1) to (4,2); + \draw[line,blue] (1,4) to (4,2); +\end{tikzpicture} +\end{preview} +\end{document} diff --git a/tikz/bounding-box-lines-4/Makefile b/tikz/bounding-box-lines-4/Makefile new file mode 100644 index 0000000..927e0c8 --- /dev/null +++ b/tikz/bounding-box-lines-4/Makefile @@ -0,0 +1,31 @@ +SOURCE = bounding-box-lines-4 +DELAY = 80 +DENSITY = 300 +WIDTH = 500 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot + +gif: + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif + make clean + +png: + make + make svg + inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png + +transparentGif: + convert $(SOURCE).pdf -transparent white result.gif + make clean + +svg: + #inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg + pdf2svg $(SOURCE).pdf $(SOURCE).svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg diff --git a/tikz/bounding-box-lines-4/bounding-box-lines-4.tex b/tikz/bounding-box-lines-4/bounding-box-lines-4.tex new file mode 100644 index 0000000..b77f7cd --- /dev/null +++ b/tikz/bounding-box-lines-4/bounding-box-lines-4.tex @@ -0,0 +1,44 @@ +\documentclass{article} +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{0mm} + +\usepackage{tkz-fct} +\usetikzlibrary{arrows, decorations.pathreplacing} +\usetikzlibrary{shapes.misc} + +\tikzset{ + line/.style={ + very thick, + black, + to path={% works only with "to" and not "--" + -- (\tikztotarget) node[at start,point] {} node [at end,point] {} \tikztonodes + } + }, + point/.style={ + ultra thick, + draw=gray, + cross out, + inner sep=0pt, + minimum width=4pt, + minimum height=4pt, + }, +} + +\begin{document} +\begin{preview} +\begin{tikzpicture} + + \draw[white,fill=white] (-0.5,-0.5) rectangle (7.2,5.2); % background + \draw[red!15,fill=red!15] (1,1) rectangle (4,4); % bounding box + \draw[blue!15,fill=blue!15] (1,4) rectangle (3,3); % bounding box + \tkzInit [xmin=0,xmax=6.5,ymin=0,ymax=4.5] + \begin{scriptsize} + \tkzGrid[color = gray!30!white] + \tkzAxeXY + \end{scriptsize} + + \draw[line,red] (1,1) to (4,4); + \draw[line,blue] (1,4) to (3,3); +\end{tikzpicture} +\end{preview} +\end{document} diff --git a/tikz/intersecting-lines-1/Makefile b/tikz/intersecting-lines-1/Makefile new file mode 100644 index 0000000..9b9fab3 --- /dev/null +++ b/tikz/intersecting-lines-1/Makefile @@ -0,0 +1,31 @@ +SOURCE = intersecting-lines-1 +DELAY = 80 +DENSITY = 300 +WIDTH = 500 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot + +gif: + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif + make clean + +png: + make + make svg + inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png + +transparentGif: + convert $(SOURCE).pdf -transparent white result.gif + make clean + +svg: + #inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg + pdf2svg $(SOURCE).pdf $(SOURCE).svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg diff --git a/tikz/intersecting-lines-1/intersecting-lines-1.tex b/tikz/intersecting-lines-1/intersecting-lines-1.tex new file mode 100644 index 0000000..8a13e99 --- /dev/null +++ b/tikz/intersecting-lines-1/intersecting-lines-1.tex @@ -0,0 +1,40 @@ +\documentclass{article} +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{0mm} + +\usepackage{tkz-fct} +\usetikzlibrary{arrows, decorations.pathreplacing} +\usetikzlibrary{shapes.misc} + +\tikzset{ + line/.style={ + very thick, + black, + to path={% works only with "to" and not "--" + -- (\tikztotarget) node[at start,point] {} node [at end,point] {} \tikztonodes + } + }, + point/.style={ + ultra thick, + draw=gray, + cross out, + inner sep=0pt, + minimum width=4pt, + minimum height=4pt, + }, +} + +\begin{document} +\begin{preview} +\begin{tikzpicture} + \draw[white,fill=white] (-0.5,-0.5) rectangle (7.2,5.2); % background + \tkzInit [xmin=0,xmax=6.5,ymin=0,ymax=4.5] + \begin{scriptsize} + \tkzGrid[color = gray!30!white] + \tkzAxeXY + \end{scriptsize} + \draw[line,red] (2,1) to (5,4); + \draw[line,blue] (1,4) to (6,1); +\end{tikzpicture} +\end{preview} +\end{document} diff --git a/tikz/intersecting-lines-2/Makefile b/tikz/intersecting-lines-2/Makefile new file mode 100644 index 0000000..e4dcb9a --- /dev/null +++ b/tikz/intersecting-lines-2/Makefile @@ -0,0 +1,31 @@ +SOURCE = intersecting-lines-2 +DELAY = 80 +DENSITY = 300 +WIDTH = 500 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot + +gif: + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif + make clean + +png: + make + make svg + inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png + +transparentGif: + convert $(SOURCE).pdf -transparent white result.gif + make clean + +svg: + #inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg + pdf2svg $(SOURCE).pdf $(SOURCE).svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg diff --git a/tikz/intersecting-lines-2/intersecting-lines-2.tex b/tikz/intersecting-lines-2/intersecting-lines-2.tex new file mode 100644 index 0000000..907a299 --- /dev/null +++ b/tikz/intersecting-lines-2/intersecting-lines-2.tex @@ -0,0 +1,40 @@ +\documentclass{article} +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{0mm} + +\usepackage{tkz-fct} +\usetikzlibrary{arrows, decorations.pathreplacing} +\usetikzlibrary{shapes.misc} + +\tikzset{ + line/.style={ + very thick, + black, + to path={% works only with "to" and not "--" + -- (\tikztotarget) node[at start,point] {} node [at end,point] {} \tikztonodes + } + }, + point/.style={ + ultra thick, + draw=gray, + cross out, + inner sep=0pt, + minimum width=4pt, + minimum height=4pt, + }, +} + +\begin{document} +\begin{preview} +\begin{tikzpicture} + \draw[white,fill=white] (-0.5,-0.5) rectangle (5.2,5.2); % background + \tkzInit [xmin=0,xmax=4.5,ymin=0,ymax=4.5] + \begin{scriptsize} + \tkzGrid[color = gray!30!white] + \tkzAxeXY + \end{scriptsize} + \draw[line,red] (1,1) to (4,4); + \draw[line,blue] (2,2) to (3,3); +\end{tikzpicture} +\end{preview} +\end{document} diff --git a/tikz/intersecting-lines-3/Makefile b/tikz/intersecting-lines-3/Makefile new file mode 100644 index 0000000..9d93c26 --- /dev/null +++ b/tikz/intersecting-lines-3/Makefile @@ -0,0 +1,31 @@ +SOURCE = intersecting-lines-3 +DELAY = 80 +DENSITY = 300 +WIDTH = 500 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot + +gif: + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif + make clean + +png: + make + make svg + inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png + +transparentGif: + convert $(SOURCE).pdf -transparent white result.gif + make clean + +svg: + #inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg + pdf2svg $(SOURCE).pdf $(SOURCE).svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg diff --git a/tikz/intersecting-lines-3/intersecting-lines-3.tex b/tikz/intersecting-lines-3/intersecting-lines-3.tex new file mode 100644 index 0000000..730e601 --- /dev/null +++ b/tikz/intersecting-lines-3/intersecting-lines-3.tex @@ -0,0 +1,40 @@ +\documentclass{article} +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{0mm} + +\usepackage{tkz-fct} +\usetikzlibrary{arrows, decorations.pathreplacing} +\usetikzlibrary{shapes.misc} + +\tikzset{ + line/.style={ + very thick, + black, + to path={% works only with "to" and not "--" + -- (\tikztotarget) node[at start,point] {} node [at end,point] {} \tikztonodes + } + }, + point/.style={ + ultra thick, + draw=gray, + cross out, + inner sep=0pt, + minimum width=4pt, + minimum height=4pt, + }, +} + +\begin{document} +\begin{preview} +\begin{tikzpicture} + \draw[white,fill=white] (-0.5,-0.5) rectangle (5.2,5.2); % background + \tkzInit [xmin=0,xmax=4.5,ymin=0,ymax=4.5] + \begin{scriptsize} + \tkzGrid[color = gray!30!white] + \tkzAxeXY + \end{scriptsize} + \draw[line,red] (2,1) to (4,2); + \draw[line,blue] (1,4) to (4,2); +\end{tikzpicture} +\end{preview} +\end{document} diff --git a/tikz/intersecting-lines-4/Makefile b/tikz/intersecting-lines-4/Makefile new file mode 100644 index 0000000..6f8a140 --- /dev/null +++ b/tikz/intersecting-lines-4/Makefile @@ -0,0 +1,31 @@ +SOURCE = intersecting-lines-4 +DELAY = 80 +DENSITY = 300 +WIDTH = 500 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot + +gif: + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif + make clean + +png: + make + make svg + inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png + +transparentGif: + convert $(SOURCE).pdf -transparent white result.gif + make clean + +svg: + #inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg + pdf2svg $(SOURCE).pdf $(SOURCE).svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg diff --git a/tikz/intersecting-lines-4/intersecting-lines-4.tex b/tikz/intersecting-lines-4/intersecting-lines-4.tex new file mode 100644 index 0000000..427deb4 --- /dev/null +++ b/tikz/intersecting-lines-4/intersecting-lines-4.tex @@ -0,0 +1,40 @@ +\documentclass{article} +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{0mm} + +\usepackage{tkz-fct} +\usetikzlibrary{arrows, decorations.pathreplacing} +\usetikzlibrary{shapes.misc} + +\tikzset{ + line/.style={ + very thick, + black, + to path={% works only with "to" and not "--" + -- (\tikztotarget) node[at start,point] {} node [at end,point] {} \tikztonodes + } + }, + point/.style={ + ultra thick, + draw=gray, + cross out, + inner sep=0pt, + minimum width=4pt, + minimum height=4pt, + }, +} + +\begin{document} +\begin{preview} +\begin{tikzpicture} + \draw[white,fill=white] (-0.5,-0.5) rectangle (5.2,5.2); % background + \tkzInit [xmin=0,xmax=4.5,ymin=0,ymax=4.5] + \begin{scriptsize} + \tkzGrid[color = gray!30!white] + \tkzAxeXY + \end{scriptsize} + \draw[line,red] (1,1) to (4,4); + \draw[line,blue] (1,4) to (3,3); +\end{tikzpicture} +\end{preview} +\end{document} diff --git a/tikz/intersecting-lines-5/Makefile b/tikz/intersecting-lines-5/Makefile new file mode 100644 index 0000000..c061ede --- /dev/null +++ b/tikz/intersecting-lines-5/Makefile @@ -0,0 +1,31 @@ +SOURCE = intersecting-lines-5 +DELAY = 80 +DENSITY = 300 +WIDTH = 500 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot + +gif: + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif + make clean + +png: + make + make svg + inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png + +transparentGif: + convert $(SOURCE).pdf -transparent white result.gif + make clean + +svg: + #inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg + pdf2svg $(SOURCE).pdf $(SOURCE).svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg diff --git a/tikz/intersecting-lines-5/intersecting-lines-5.tex b/tikz/intersecting-lines-5/intersecting-lines-5.tex new file mode 100644 index 0000000..a16b67d --- /dev/null +++ b/tikz/intersecting-lines-5/intersecting-lines-5.tex @@ -0,0 +1,47 @@ +\documentclass{article} +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{0mm} + +\usepackage{tkz-fct} +\usetikzlibrary{arrows, decorations.pathreplacing} +\usetikzlibrary{shapes.misc} + +\tikzset{ + line/.style={ + thick, + black, + to path={% works only with "to" and not "--" + -- (\tikztotarget) node[at start,point] {} node [at end,point] {} \tikztonodes + } + }, + line2/.style={ + ultra thick, + black, + to path={% works only with "to" and not "--" + -- (\tikztotarget) node[at start,point] {} node [at end,point] {} \tikztonodes + } + }, + point/.style={ + ultra thick, + draw=gray, + cross out, + inner sep=0pt, + minimum width=4pt, + minimum height=4pt, + }, +} + +\begin{document} +\begin{preview} +\begin{tikzpicture} + \draw[white,fill=white] (-0.5,-0.5) rectangle (5.2,5.2); % background + \tkzInit [xmin=0,xmax=4.5,ymin=0,ymax=4.5] + \begin{scriptsize} + \tkzGrid[color = gray!30!white] + \tkzAxeXY + \end{scriptsize} + \draw[line2,red] (2,2) to (4,4); + \draw[line,blue] (1,1) to (3,3); +\end{tikzpicture} +\end{preview} +\end{document} diff --git a/tikz/lines-intersections/Makefile b/tikz/lines-intersections/Makefile new file mode 100644 index 0000000..ebde195 --- /dev/null +++ b/tikz/lines-intersections/Makefile @@ -0,0 +1,31 @@ +SOURCE = lines-intersections +DELAY = 80 +DENSITY = 300 +WIDTH = 500 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot + +gif: + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif + make clean + +png: + make + make svg + inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png + +transparentGif: + convert $(SOURCE).pdf -transparent white result.gif + make clean + +svg: + #inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg + pdf2svg $(SOURCE).pdf $(SOURCE).svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg diff --git a/tikz/lines-intersections/lines-intersections.tex b/tikz/lines-intersections/lines-intersections.tex new file mode 100644 index 0000000..5adfbc3 --- /dev/null +++ b/tikz/lines-intersections/lines-intersections.tex @@ -0,0 +1,55 @@ +\documentclass{article} +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{2mm} + +\usepackage{tkz-fct} +\usetikzlibrary{arrows, decorations.pathreplacing} +\usetikzlibrary{shapes.misc} + +\tikzset{ + line/.style={ + very thick, + black, + to path={% works only with "to" and not "--" + -- (\tikztotarget) node[at start,point] {} node [at end,point] {} \tikztonodes + } + }, + point/.style={ + thick, + draw=gray, + cross out, + inner sep=0pt, + minimum width=4pt, + minimum height=4pt, + }, +} + +\begin{document} +\begin{preview} +\begin{tikzpicture} + \draw[white,fill=white] (-1,-1) rectangle (22,8); % background + \tkzInit [xmin=0,xmax=21,ymin=0,ymax=7] + \begin{scriptsize} + \tkzGrid[color = gray!30!white] + \tkzAxeXY + \end{scriptsize} + \draw[line] (1,4) to (6,1); + \draw[line] (2,1) to (5,4); + \draw[line] (3,1) to (6,4); + \draw[line] (4,1) to (8,5); + \draw[line] (3,4) to (9,3); + \draw[line] (7,2) to (9,3); + \draw[line] (6,7) to (9,1); + + \draw[line] (11,1) to (16,5); + \draw[line] (13,2) to (14,2); + \draw[line] (14,1) to (14,2); + \draw[line] (14,3) to (15,2); + \draw[line] (15,4) to (15,3); + \draw[line] (13,4) to (13,3); + + \draw[line] (17,3) to (21,3); + \draw[line] (19,1) to (19,5); +\end{tikzpicture} +\end{preview} +\end{document}