浏览代码

Add tikz/triangle-right-abchpq

Martin Thoma 9 年之前
父节点
当前提交
42266527cd

+ 33 - 0
tikz/triangle-right-abchpq/Makefile

@@ -0,0 +1,33 @@
+SOURCE = triangle-right-abchpq
+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

+ 3 - 0
tikz/triangle-right-abchpq/README.md

@@ -0,0 +1,3 @@
+Compiled example
+----------------
+![Example](triangle-right-abchpq.png)

二进制
tikz/triangle-right-abchpq/triangle-right-abchpq.png


+ 55 - 0
tikz/triangle-right-abchpq/triangle-right-abchpq.tex

@@ -0,0 +1,55 @@
+\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]
+    \newcommand{\radius}{5}
+    \newcommand{\TriangleAngle}{30}
+    \tkzDefPoint(0,0){A}
+    \tkzDefPoint(\radius,0){B}
+    \tkzDefPoint(\TriangleAngle:{cos(\TriangleAngle*\FPpi/180)*\radius}){C}
+    \tkzDefPoint({cos(\TriangleAngle*\FPpi/180)*\radius*cos(\TriangleAngle*\FPpi/180)},0){E}
+
+    % \tkzLabelPoints[below left,font=\sansmath\sffamily](A)
+    % \tkzLabelPoints[below right,font=\sansmath\sffamily](B)
+    % \tkzLabelPoints[above,font=\sansmath\sffamily](C)
+
+    % Draw polygon
+    \tkzDrawPolygon[fill=gray!10](A,B,C)
+
+    % Label lines
+    \tkzLabelSegment[right](B,C){$a$}
+    \tkzLabelSegment[above left=-0.1](A,C){$b$}
+    \tkzLabelSegment[below](A,B){$c$}
+    \tkzLabelSegment[above=-0.1](A,E){$q$}
+    \tkzLabelSegment[above=-0.1](E,B){$p$}
+
+    % 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[left](C,E){$h$}
+
+    \draw[thin] pic[draw, angle radius=2mm,"$\cdot$",angle eccentricity=.5]{angle=B--E--C};
+    \draw[thin] pic[draw, angle radius=2mm,"$\cdot$",angle eccentricity=.5]{angle=A--C--B};
+
+    % Draw polygon
+    \tkzDrawPolygon(A,B,C)
+\end{tikzpicture}
+\end{preview}
+\end{document}