mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-19 11:38:05 +02:00
Add tikz/triangle-law-of-cosines
This commit is contained in:
parent
76ebec17a2
commit
f8f167631c
4 changed files with 86 additions and 0 deletions
33
tikz/triangle-law-of-cosines/Makefile
Normal file
33
tikz/triangle-law-of-cosines/Makefile
Normal file
|
@ -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
|
3
tikz/triangle-law-of-cosines/README.md
Normal file
3
tikz/triangle-law-of-cosines/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Compiled example
|
||||||
|
----------------
|
||||||
|

|
BIN
tikz/triangle-law-of-cosines/triangle-law-of-cosines.png
Normal file
BIN
tikz/triangle-law-of-cosines/triangle-law-of-cosines.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.8 KiB |
50
tikz/triangle-law-of-cosines/triangle-law-of-cosines.tex
Normal file
50
tikz/triangle-law-of-cosines/triangle-law-of-cosines.tex
Normal file
|
@ -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}
|
Loading…
Add table
Add a link
Reference in a new issue