diff --git a/tikz/triangle-law-of-cosines/Makefile b/tikz/triangle-law-of-cosines/Makefile new file mode 100644 index 0000000..58ec13e --- /dev/null +++ b/tikz/triangle-law-of-cosines/Makefile @@ -0,0 +1,33 @@ +SOURCE = triangle-law-of-cosines +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 *.fdb_latexmk *.synctex.gz + +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)1.svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE)1.svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg + rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg + rm $(SOURCE)1.svg \ No newline at end of file diff --git a/tikz/triangle-law-of-cosines/README.md b/tikz/triangle-law-of-cosines/README.md new file mode 100644 index 0000000..f614ddb --- /dev/null +++ b/tikz/triangle-law-of-cosines/README.md @@ -0,0 +1,3 @@ +Compiled example +---------------- +![Example](triangle-law-of-cosines.png) diff --git a/tikz/triangle-law-of-cosines/triangle-law-of-cosines.png b/tikz/triangle-law-of-cosines/triangle-law-of-cosines.png new file mode 100644 index 0000000..69ebf27 Binary files /dev/null and b/tikz/triangle-law-of-cosines/triangle-law-of-cosines.png differ diff --git a/tikz/triangle-law-of-cosines/triangle-law-of-cosines.tex b/tikz/triangle-law-of-cosines/triangle-law-of-cosines.tex new file mode 100644 index 0000000..b695747 --- /dev/null +++ b/tikz/triangle-law-of-cosines/triangle-law-of-cosines.tex @@ -0,0 +1,50 @@ +\documentclass{article} +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{2mm} +\usepackage{tikz} +\usepackage{tkz-euclide} +\usetikzlibrary{angles,quotes} + +\usetkzobj{all} +\usetikzlibrary{shapes, calc, decorations} +\usepackage{amsmath,amssymb} +\usepackage{helvet} +\usepackage[eulergreek]{sansmath} + +\begin{document} +\begin{preview} +\begin{tikzpicture}[very thick,font=\sansmath\sffamily] + \tkzDefPoint(5,2){A} + \tkzDefPoint(0,0){B} + \tkzDefPoint(6.8,0){C} + \tkzDefPoint(5,0){E} + + % \tkzLabelPoints[above,font=\sansmath\sffamily](A) + % \tkzLabelPoints[below left,font=\sansmath\sffamily](B) + % \tkzLabelPoints[below right,font=\sansmath\sffamily](C) + + % Draw polygon + \tkzDrawPolygon[fill=gray!10](A,B,C) + + % Label line segments + \tkzLabelSegment[below](B,C){$a$} + \tkzLabelSegment[right](A,C){$b$} + \tkzLabelSegment[above left](A,B){$c$} + \tkzLabelSegment[above](B,E){$d$} + \tkzLabelSegment[above](E,C){$e$} + + % Mark angles + \tkzMarkAngle[arc=l,size=0.6cm,fill=green!30](A,C,B) + \tkzLabelAngle[pos=0.42](A,C,B){$\gamma$} + + \tkzDrawSegment[dashed](A,E) + \tkzLabelSegment[left](A,E){$h$} + + \draw[thin] pic[draw, angle radius=2mm,"$\cdot$",angle eccentricity=.5]{ + angle=C--E--A}; + + % Draw polygon + \tkzDrawPolygon(A,B,C) +\end{tikzpicture} +\end{preview} +\end{document}