소스 검색

Add tikz/cos-fixpoint

Martin Thoma 9 년 전
부모
커밋
afaf9d4d90
4개의 변경된 파일72개의 추가작업 그리고 0개의 파일을 삭제
  1. 31 0
      tikz/cos-fixpoint/Makefile
  2. 3 0
      tikz/cos-fixpoint/README.md
  3. BIN
      tikz/cos-fixpoint/cos-fixpoint.png
  4. 38 0
      tikz/cos-fixpoint/cos-fixpoint.tex

+ 31 - 0
tikz/cos-fixpoint/Makefile

@@ -0,0 +1,31 @@
+SOURCE = cos-fixpoint
+DELAY = 80
+DENSITY = 300
+WIDTH = 500
+
+make:
+	pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
+	make clean
+
+clean:
+	rm -rf  $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot *.table
+
+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

+ 3 - 0
tikz/cos-fixpoint/README.md

@@ -0,0 +1,3 @@
+Compiled example
+----------------
+![Example](cos-fixpoint.png)

BIN
tikz/cos-fixpoint/cos-fixpoint.png


+ 38 - 0
tikz/cos-fixpoint/cos-fixpoint.tex

@@ -0,0 +1,38 @@
+\documentclass{article}
+\usepackage[pdftex,active,tightpage]{preview}
+\setlength\PreviewBorder{0mm}
+
+\usepackage{pgfplots}
+\pgfplotsset{compat=1.9}
+
+\begin{document}
+\begin{preview}
+\begin{tikzpicture}
+    \begin{axis}[
+        axis x line=middle,
+        axis y line=middle,
+        enlarge y limits=true,
+        enlarge x limits=true,
+        xmin=0, xmax=pi, % x domain
+        width=12cm, height=8cm,     % size of the image
+        grid = major,
+        grid style={dashed, gray!30},
+        ymin=-1,      % start the diagram at this y-coordinate
+        ymax= 1,      % end   the diagram at this y-coordinate
+        % axis background/.style={fill=white},
+        ylabel=$y$,
+        xlabel=$x$,
+        xtick={0,1.5708,3.14159},
+        xticklabels={$0$,$\frac{\pi}{2}$,$\pi$},
+        legend style={at={(0.2,0.37)}, anchor=north, fill=none}
+     ]
+      \addplot[domain=-8:8,very thick,samples=200,blue]   {cos(deg(x))};
+      \addplot[domain=-8:8,very thick,samples=200,red]   {x};
+      \coordinate (a) at (axis cs:0.739085,0.739085);
+      \fill[red] (a) circle (3pt);
+      \node[label={[label distance=0.1cm]0:$x = y \approx 0.739085$}] at (a) {};
+      \legend{$\cos x$, $x$}
+    \end{axis}
+\end{tikzpicture}
+\end{preview}
+\end{document}