Преглед изворни кода

added interstection examples

Martin Thoma пре 12 година
родитељ
комит
9134d13eac

+ 31 - 0
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

+ 45 - 0
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}

+ 31 - 0
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

+ 43 - 0
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}

+ 31 - 0
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

+ 44 - 0
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}

+ 31 - 0
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

+ 44 - 0
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}

+ 31 - 0
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

+ 40 - 0
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}

+ 31 - 0
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

+ 40 - 0
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}

+ 31 - 0
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

+ 40 - 0
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}

+ 31 - 0
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

+ 40 - 0
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}

+ 31 - 0
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

+ 47 - 0
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}

+ 31 - 0
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

+ 55 - 0
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}