Browse Source

tikz/parallelogram-triangle-area: added

Martin Thoma 10 năm trước cách đây
mục cha
commit
8d16f86f15

+ 33 - 0
tikz/parallelogram-triangle-area/Makefile

@@ -0,0 +1,33 @@
+SOURCE = parallelogram-triangle-area
+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/parallelogram-triangle-area/README.md

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

BIN
tikz/parallelogram-triangle-area/parallelogram-triangle-area.png


+ 57 - 0
tikz/parallelogram-triangle-area/parallelogram-triangle-area.tex

@@ -0,0 +1,57 @@
+\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(5,3){C}
+    \tkzDefPoint(1,3){D}
+    \tkzDefPoint(1,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[thick,fill=gray!10](A,B,C,D)
+
+    % \tkzMarkAngle[arc=l,size=0.6cm,fill=red!30](C,B,A)
+    % \tkzLabelAngle[pos=0.4](C,B,A){$\beta$}
+
+    % \tkzMarkAngle[arc=l,size=0.6cm,fill=blue!30](A,C,B)
+    % \tkzLabelAngle[pos=0.4](A,C,B){$\gamma$}
+
+    % Label lines
+    \tkzLabelSegment[below](A,B){$a$}
+    \tkzLabelSegment[left](A,D){$b$}
+    % \tkzLabelSegment[right](B,C){$a$}
+
+    % Draw polygon
+    \tkzDrawPolygon[fill=blue!30](A,B,D)
+
+    % Mark angles
+    \tkzMarkAngle[arc=l,size=0.6cm,fill=green!30](B,A,D)
+    \tkzLabelAngle[pos=0.3](B,A,D){$\gamma$}
+
+    % Draw polygon
+    \tkzDrawPolygon[thick](A,B,C,D)
+
+    \tkzDrawSegment[dashed](D,E)
+    \tkzLabelSegment[right](D,E){$h$}
+
+    \draw[thin] pic[draw, angle radius=2mm,"$\cdot$",angle eccentricity=.5]{angle=B--E--D};
+\end{tikzpicture}
+\end{preview}
+\end{document}