diff --git a/tikz/3d-vector/3d-vector.png b/tikz/3d-vector/3d-vector.png new file mode 100644 index 0000000..264ce00 Binary files /dev/null and b/tikz/3d-vector/3d-vector.png differ diff --git a/tikz/3d-vector/3d-vector.tex b/tikz/3d-vector/3d-vector.tex new file mode 100644 index 0000000..3879bd9 --- /dev/null +++ b/tikz/3d-vector/3d-vector.tex @@ -0,0 +1,33 @@ +\documentclass{article} +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{2mm} +\usepackage{tikz} +\usepackage{tikz-3dplot} + +\begin{document} +\begin{preview} + \tdplotsetmaincoords{70}{110} + + \begin{tikzpicture}[scale=3,tdplot_main_coords] + \draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$}; + \draw[thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$}; + \draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$}; + \tdplotsetcoord{O}{0}{0}{0} + \tdplotsetcoord{P}{.8}{50}{70} + + %draw a vector from origin to point (P) + \draw[-stealth,color=red] (O) -- (P); + + %draw projection on xy plane, and a connecting line + \draw[dashed, color=red] (O) -- (Pxy); + \draw[dashed, color=red] (P) -- (Pxy); + \tdplotsetthetaplanecoords{70} + \draw[tdplot_rotated_coords,color=blue,thick,->] (0,0,0) + -- (.2,0,0) node[anchor=east]{$x'$}; + \draw[tdplot_rotated_coords,color=blue,thick,->] (0,0,0) + -- (0,.2,0) node[anchor=north]{$y'$}; + \draw[tdplot_rotated_coords,color=blue,thick,->] (0,0,0) + -- (0,0,.2) node[anchor=west]{$z'$}; + \end{tikzpicture} +\end{preview} +\end{document} diff --git a/tikz/3d-vector/Makefile b/tikz/3d-vector/Makefile new file mode 100644 index 0000000..453531a --- /dev/null +++ b/tikz/3d-vector/Makefile @@ -0,0 +1,35 @@ +SOURCE = 3d-vector +DELAY = 80 +DENSITY = 300 +WIDTH = 512 + +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: + make + #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 + rsvg-convert -a -w $(WIDTH) -f svg $(SOURCE).svg -o $(SOURCE)2.svg + inkscape $(SOURCE)2.svg --export-plain-svg=$(SOURCE).svg + rm $(SOURCE)2.svg diff --git a/tikz/3d-vector/Readme.md b/tikz/3d-vector/Readme.md new file mode 100644 index 0000000..4032346 --- /dev/null +++ b/tikz/3d-vector/Readme.md @@ -0,0 +1,3 @@ +Manual +------ +[TikZ - 3d plot](http://sunsite.informatik.rwth-aachen.de/ftp/pub/mirror/ctan/graphics/pgf/contrib/tikz-3dplot/tikz-3dplot_documentation.pdf) diff --git a/tikz/vector-addition-and-scaling/Makefile b/tikz/vector-addition-and-scaling/Makefile index b00d208..10e10ac 100644 --- a/tikz/vector-addition-and-scaling/Makefile +++ b/tikz/vector-addition-and-scaling/Makefile @@ -1,14 +1,14 @@ SOURCE = vector-addition-and-scaling DELAY = 80 DENSITY = 300 -WIDTH = 500 +WIDTH = 512 make: pdflatex $(SOURCE).tex -output-format=pdf make clean clean: - rm -rf $(TARGET) *.class *.html *.log *.aux + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot gif: pdfcrop $(SOURCE).pdf @@ -25,7 +25,11 @@ transparentGif: make clean svg: + make #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 + rsvg-convert -a -w $(WIDTH) -f svg $(SOURCE).svg -o $(SOURCE)2.svg + inkscape $(SOURCE)2.svg --export-plain-svg=$(SOURCE).svg + rm $(SOURCE)2.svg diff --git a/tikz/vector-addition-and-scaling/vector-addition-and-scaling.png b/tikz/vector-addition-and-scaling/vector-addition-and-scaling.png new file mode 100644 index 0000000..5e9b8c8 Binary files /dev/null and b/tikz/vector-addition-and-scaling/vector-addition-and-scaling.png differ diff --git a/tikz/vector-triangle-inequality/Makefile b/tikz/vector-triangle-inequality/Makefile index 315150f..d7603d3 100644 --- a/tikz/vector-triangle-inequality/Makefile +++ b/tikz/vector-triangle-inequality/Makefile @@ -1,14 +1,14 @@ SOURCE = vector-triangle-inequality DELAY = 80 DENSITY = 300 -WIDTH = 500 +WIDTH = 512 make: pdflatex $(SOURCE).tex -output-format=pdf make clean clean: - rm -rf $(TARGET) *.class *.html *.log *.aux + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot gif: pdfcrop $(SOURCE).pdf diff --git a/tikz/vector-triangle-inequality/vector-triangle-inequality.png b/tikz/vector-triangle-inequality/vector-triangle-inequality.png new file mode 100644 index 0000000..2b89626 Binary files /dev/null and b/tikz/vector-triangle-inequality/vector-triangle-inequality.png differ