diff --git a/tikz/cos-fixpoint/Makefile b/tikz/cos-fixpoint/Makefile new file mode 100644 index 0000000..2dfff4b --- /dev/null +++ b/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 diff --git a/tikz/cos-fixpoint/README.md b/tikz/cos-fixpoint/README.md new file mode 100644 index 0000000..2a0d637 --- /dev/null +++ b/tikz/cos-fixpoint/README.md @@ -0,0 +1,3 @@ +Compiled example +---------------- +![Example](cos-fixpoint.png) diff --git a/tikz/cos-fixpoint/cos-fixpoint.png b/tikz/cos-fixpoint/cos-fixpoint.png new file mode 100644 index 0000000..b3703f1 Binary files /dev/null and b/tikz/cos-fixpoint/cos-fixpoint.png differ diff --git a/tikz/cos-fixpoint/cos-fixpoint.tex b/tikz/cos-fixpoint/cos-fixpoint.tex new file mode 100644 index 0000000..9031b5b --- /dev/null +++ b/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}