Browse Source

added pentagon with inscribed circle

Martin Thoma 10 years ago
parent
commit
7934ea7c16

+ 33 - 0
tikz/pentagon-inscribed-circle/Makefile

@@ -0,0 +1,33 @@
+SOURCE = pentagon-inscribed-circle
+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/pentagon-inscribed-circle/README.md

@@ -0,0 +1,3 @@
+Compiled example
+----------------
+![Example](pentagon-inscribed-circle.png)

BIN
tikz/pentagon-inscribed-circle/pentagon-inscribed-circle.png


+ 58 - 0
tikz/pentagon-inscribed-circle/pentagon-inscribed-circle.tex

@@ -0,0 +1,58 @@
+\documentclass{article}
+\usepackage[pdftex,active,tightpage]{preview}
+\setlength\PreviewBorder{2mm}
+\usepackage{tikz}
+\usepackage{tkz-euclide}
+\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){CircleCenter}
+    \tkzDrawCircle[R](CircleCenter,3cm)
+
+    % Define 5 points on a circle
+    \tkzDefPoint( 30:3){BCT}
+    \tkzDefPoint( 90:3){CDT}
+    \tkzDefPoint(135:3){DET}
+    \tkzDefPoint(215:3){EAT}
+    \tkzDefPoint(300:3){ABT}
+
+    % Tangents
+    \tkzDefLine[perpendicular=through EAT](CircleCenter,EAT)\tkzGetPoint{EAT2}
+    \tkzDefLine[perpendicular=through BCT](CircleCenter,BCT)\tkzGetPoint{BCT2}
+    \tkzDefLine[perpendicular=through CDT](CircleCenter,CDT)\tkzGetPoint{CDT2}
+    \tkzDefLine[perpendicular=through DET](CircleCenter,DET)\tkzGetPoint{DET2}
+    \tkzDefLine[perpendicular=through ABT](CircleCenter,ABT)\tkzGetPoint{ABT2}
+
+    % Find the points by intersecting the tangents
+    \tkzInterLL(EAT,EAT2)(ABT,ABT2)\tkzGetPoint{A}
+    \tkzInterLL(ABT,ABT2)(BCT,BCT2)\tkzGetPoint{B}
+    \tkzInterLL(BCT,BCT2)(CDT,CDT2)\tkzGetPoint{C}
+    \tkzInterLL(CDT,CDT2)(DET,DET2)\tkzGetPoint{D}
+    \tkzInterLL(DET,DET2)(EAT,EAT2)\tkzGetPoint{E}
+
+    % Background
+    \tkzDrawPolygon[thick,fill=gray!10](A,B,C,D,E)
+
+    \tkzDrawSegments(CircleCenter,EAT CircleCenter,BCT CircleCenter,CDT CircleCenter,DET CircleCenter,ABT)
+
+    % Draw points
+    \tkzDrawPoints[size=1pt](A,B,C,D,E)
+    \tkzDrawCircle[R,thick,draw=red](CircleCenter,3cm)
+    \tkzLabelPoints[below left,font=\sansmath\sffamily](A)
+    \tkzLabelPoints[below right,font=\sansmath\sffamily](B)
+    \tkzLabelPoints[above right,font=\sansmath\sffamily](C)
+    \tkzLabelPoints[above left,font=\sansmath\sffamily](D)
+    \tkzLabelPoints[left,font=\sansmath\sffamily](E)
+
+
+    % % Draw polygon
+    \tkzDrawPolygon[very thick](A,B,C,D,E)
+\end{tikzpicture}
+\end{preview}
+\end{document}