diff --git a/tikz/triangle-law-of-sines/Makefile b/tikz/triangle-law-of-sines/Makefile new file mode 100644 index 0000000..ccfb637 --- /dev/null +++ b/tikz/triangle-law-of-sines/Makefile @@ -0,0 +1,33 @@ +SOURCE = triangle-law-of-sines +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: + #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-sines/README.md b/tikz/triangle-law-of-sines/README.md new file mode 100644 index 0000000..dedf49b --- /dev/null +++ b/tikz/triangle-law-of-sines/README.md @@ -0,0 +1,3 @@ +Compiled example +---------------- +![Example](triangle-law-of-sines.png) diff --git a/tikz/triangle-law-of-sines/triangle-law-of-sines.png b/tikz/triangle-law-of-sines/triangle-law-of-sines.png new file mode 100644 index 0000000..18bb799 Binary files /dev/null and b/tikz/triangle-law-of-sines/triangle-law-of-sines.png differ diff --git a/tikz/triangle-law-of-sines/triangle-law-of-sines.tex b/tikz/triangle-law-of-sines/triangle-law-of-sines.tex new file mode 100644 index 0000000..f1f8215 --- /dev/null +++ b/tikz/triangle-law-of-sines/triangle-law-of-sines.tex @@ -0,0 +1,48 @@ +\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(0,0){A} + \tkzDefPoint(4,0){B} + \tkzDefPoint(1,3){C} + \tkzDefPoint(1,0){E} + + % \tkzLabelPoints[below left,font=\sansmath\sffamily](A) + % \tkzLabelPoints[below right,font=\sansmath\sffamily](B) + + % Label lines + \tkzLabelSegment[right](B,C){$a$} + \tkzLabelSegment[left](A,C){$b$} + + % Draw polygon + \tkzDrawPolygon[fill=gray!10](A,B,C) + + % Mark angles + \tkzMarkAngle[arc=l,size=0.6cm,fill=green!30](B,A,C) + \tkzLabelAngle[pos=0.3](B,A,C){$\alpha$} + + \tkzMarkAngle[arc=l,size=0.6cm,fill=green!30](C,B,A) + \tkzLabelAngle[pos=0.45](C,B,A){$\beta$} + + \tkzDrawSegment[dashed](C,E) + \tkzLabelSegment[right](C,E){$h_c$} + + \draw[thin] pic[draw, angle radius=2mm,"$\cdot$",angle eccentricity=.5]{angle=B--E--C}; + + % Draw polygon + \tkzDrawPolygon(A,B,C) +\end{tikzpicture} +\end{preview} +\end{document}