Przeglądaj źródła

added some 3d functions

Martin Thoma 13 lat temu
rodzic
commit
63432b0bc1

+ 40 - 0
tikz/3d-function-3/3d-function-3.tex

@@ -0,0 +1,40 @@
+\documentclass{article}
+\usepackage[pdftex,active,tightpage]{preview}
+\setlength\PreviewBorder{2mm}
+\usepackage{pgfplots}
+
+\begin{document}
+\begin{preview}
+\pgfplotsset{
+    colormap={whitered}{
+        color(0cm)=(white);
+        color(1cm)=(orange!75!red)
+    }
+}
+\begin{tikzpicture}
+    \begin{axis}[
+    colormap name=whitered,
+    width=15cm,
+    view={10}{65},
+    enlargelimits=false,
+    grid=major,
+    domain=-5:5,
+    y domain=-5:5,
+    samples=56, %57 : TeX capacity exceeded, sorry [main memory size=3000000].
+                % see also http://tex.stackexchange.com/a/7954/5645
+    xlabel=$x$,
+    ylabel=$y$,
+    zlabel={$z$},
+    colorbar,
+    colorbar style={
+        at={(-0.1,0)},
+        anchor=south west,
+        height=0.25*\pgfkeysvalueof{/pgfplots/parent axis height},
+        title={$f(x,y)$}
+    }
+    ]
+      \addplot3[surf] {2*x*y/(x*x+y*y)};
+    \end{axis} 
+\end{tikzpicture}
+\end{preview}
+\end{document}

+ 31 - 0
tikz/3d-function-3/Makefile

@@ -0,0 +1,31 @@
+SOURCE = 3d-function-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/3d-function-4/3d-function-4.tex

@@ -0,0 +1,40 @@
+\documentclass{article}
+\usepackage[pdftex,active,tightpage]{preview}
+\setlength\PreviewBorder{2mm}
+\usepackage{pgfplots}
+
+\begin{document}
+\begin{preview}
+\pgfplotsset{
+    colormap={whitered}{
+        color(0cm)=(white);
+        color(1cm)=(orange!75!red)
+    }
+}
+\begin{tikzpicture}
+    \begin{axis}[
+    colormap name=whitered,
+    width=15cm,
+    view={10}{65},
+    enlargelimits=false,
+    grid=major,
+    domain=-5:5,
+    y domain=-5:5,
+    samples=56, %57 : TeX capacity exceeded, sorry [main memory size=3000000].
+                % see also http://tex.stackexchange.com/a/7954/5645
+    xlabel=$x$,
+    ylabel=$y$,
+    zlabel={$z$},
+    colorbar,
+    colorbar style={
+        at={(-0.1,0)},
+        anchor=south west,
+        height=0.25*\pgfkeysvalueof{/pgfplots/parent axis height},
+        title={$f(x,y)$}
+    }
+    ]
+      \addplot3[surf] {2*x*y/sqrt(x*x+y*y)};
+    \end{axis} 
+\end{tikzpicture}
+\end{preview}
+\end{document}

+ 31 - 0
tikz/3d-function-4/Makefile

@@ -0,0 +1,31 @@
+SOURCE = 3d-function-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/3d-function-5/3d-function-5.tex

@@ -0,0 +1,40 @@
+\documentclass{article}
+\usepackage[pdftex,active,tightpage]{preview}
+\setlength\PreviewBorder{2mm}
+\usepackage{pgfplots}
+
+\begin{document}
+\begin{preview}
+\pgfplotsset{
+    colormap={whitered}{
+        color(0cm)=(white);
+        color(1cm)=(orange!75!red)
+    }
+}
+\begin{tikzpicture}
+    \begin{axis}[
+    colormap name=whitered,
+    width=15cm,
+    view={65}{35},
+    enlargelimits=false,
+    grid=major,
+    domain=-5:5,
+    y domain=-5:5,
+    samples=56, %57 : TeX capacity exceeded, sorry [main memory size=3000000].
+                % see also http://tex.stackexchange.com/a/7954/5645
+    xlabel=$x$,
+    ylabel=$y$,
+    zlabel={$z$},
+    colorbar,
+    colorbar style={
+        at={(-0.1,0)},
+        anchor=south west,
+        height=0.25*\pgfkeysvalueof{/pgfplots/parent axis height},
+        title={$f(x,y)$}
+    }
+    ]
+      \addplot3[surf] {x*x+y*y};
+    \end{axis} 
+\end{tikzpicture}
+\end{preview}
+\end{document}

+ 31 - 0
tikz/3d-function-5/Makefile

@@ -0,0 +1,31 @@
+SOURCE = 3d-function-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

+ 40 - 0
tikz/3d-function-6/3d-function-6.tex

@@ -0,0 +1,40 @@
+\documentclass{article}
+\usepackage[pdftex,active,tightpage]{preview}
+\setlength\PreviewBorder{2mm}
+\usepackage{pgfplots}
+
+\begin{document}
+\begin{preview}
+\pgfplotsset{
+    colormap={whitered}{
+        color(0cm)=(white);
+        color(1cm)=(orange!75!red)
+    }
+}
+\begin{tikzpicture}
+    \begin{axis}[
+    colormap name=whitered,
+    width=15cm,
+    view={65}{35},
+    enlargelimits=false,
+    grid=major,
+    domain=-5:5,
+    y domain=-5:5,
+    samples=56, %57 : TeX capacity exceeded, sorry [main memory size=3000000].
+                % see also http://tex.stackexchange.com/a/7954/5645
+    xlabel=$x$,
+    ylabel=$y$,
+    zlabel={$z$},
+    colorbar,
+    colorbar style={
+        at={(-0.1,0)},
+        anchor=south west,
+        height=0.25*\pgfkeysvalueof{/pgfplots/parent axis height},
+        title={$f(x,y)$}
+    }
+    ]
+      \addplot3[surf] {(3*x*x*y-y*y*y)/(x*x+y*y)};
+    \end{axis} 
+\end{tikzpicture}
+\end{preview}
+\end{document}

+ 31 - 0
tikz/3d-function-6/Makefile

@@ -0,0 +1,31 @@
+SOURCE = 3d-function-6
+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/3d-function-7/3d-function-7.tex

@@ -0,0 +1,40 @@
+\documentclass{article}
+\usepackage[pdftex,active,tightpage]{preview}
+\setlength\PreviewBorder{2mm}
+\usepackage{pgfplots}
+
+\begin{document}
+\begin{preview}
+\pgfplotsset{
+    colormap={whitered}{
+        color(0cm)=(white);
+        color(1cm)=(orange!75!red)
+    }
+}
+\begin{tikzpicture}
+    \begin{axis}[
+    colormap name=whitered,
+    width=15cm,
+    view={65}{65},
+    enlargelimits=false,
+    grid=major,
+    domain=-5:5,
+    y domain=-5:5,
+    samples=56, %57 : TeX capacity exceeded, sorry [main memory size=3000000].
+                % see also http://tex.stackexchange.com/a/7954/5645
+    xlabel=$x$,
+    ylabel=$y$,
+    zlabel={$z$},
+    colorbar,
+    colorbar style={
+        at={(-0.1,0)},
+        anchor=south west,
+        height=0.25*\pgfkeysvalueof{/pgfplots/parent axis height},
+        title={$f(x,y)$}
+    }
+    ]
+      \addplot3[surf] {x*y*y*y/(x*x+y*y*y*y)};
+    \end{axis} 
+\end{tikzpicture}
+\end{preview}
+\end{document}

+ 31 - 0
tikz/3d-function-7/Makefile

@@ -0,0 +1,31 @@
+SOURCE = 3d-function-7
+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/3d-function-8/3d-function-8.tex

@@ -0,0 +1,40 @@
+\documentclass{article}
+\usepackage[pdftex,active,tightpage]{preview}
+\setlength\PreviewBorder{2mm}
+\usepackage{pgfplots}
+
+\begin{document}
+\begin{preview}
+\pgfplotsset{
+    colormap={whitered}{
+        color(0cm)=(white);
+        color(1cm)=(orange!75!red)
+    }
+}
+\begin{tikzpicture}
+    \begin{axis}[
+    colormap name=whitered,
+    width=15cm,
+    view={65}{65},
+    enlargelimits=false,
+    grid=major,
+    domain=-5:5,
+    y domain=-5:5,
+    samples=50, %57 : TeX capacity exceeded, sorry [main memory size=3000000].
+                % see also http://tex.stackexchange.com/a/7954/5645
+    xlabel=$x$,
+    ylabel=$y$,
+    zlabel={$z$},
+    colorbar,
+    colorbar style={
+        at={(-0.1,0)},
+        anchor=south west,
+        height=0.25*\pgfkeysvalueof{/pgfplots/parent axis height},
+        title={$f(x,y)$}
+    }
+    ]
+      \addplot3[surf] {(x^2+y^2)*sin(1/(x^2+y^2))};
+    \end{axis} 
+\end{tikzpicture}
+\end{preview}
+\end{document}

+ 31 - 0
tikz/3d-function-8/Makefile

@@ -0,0 +1,31 @@
+SOURCE = 3d-function-8
+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