Browse Source

added circle inscirbed circumscribed polygon

Martin Thoma 12 years ago
parent
commit
a8ab55d4b3

+ 35 - 0
tikz/circle-inscribed-circumscribed-polygon/Makefile

@@ -0,0 +1,35 @@
+SOURCE = circle-inscribed-circumscribed-polygon
+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:
+	make
+	#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
+	pdf2svg $(SOURCE).pdf $(SOURCE).svg
+	# Necessary, as pdf2svg does not always create valid svgs:
+	inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg
+	rsvg-convert -a -w $(WIDTH) -f svg $(SOURCE).svg -o $(SOURCE)2.svg
+	inkscape $(SOURCE)2.svg --export-plain-svg=$(SOURCE).svg
+	rm $(SOURCE)2.svg

+ 3 - 0
tikz/circle-inscribed-circumscribed-polygon/Readme.md

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

BIN
tikz/circle-inscribed-circumscribed-polygon/circle-inscribed-circumscribed-polygon.png


+ 27 - 0
tikz/circle-inscribed-circumscribed-polygon/circle-inscribed-circumscribed-polygon.tex

@@ -0,0 +1,27 @@
+\documentclass[varwidth=true, border=2pt]{standalone}
+\usepackage{tikz}
+\usetikzlibrary{calc} 
+\usepackage{amsmath,amssymb}
+
+\begin{document}
+\begin{tikzpicture}
+    \newcommand{\R}{1.5} % radius of the circle
+    \newcommand{\n}{6} % edges of the polygon
+
+    % Center
+    \path ( 0,0) coordinate (M);
+
+    % Inner polygon
+    \foreach \nr in {1, ..., \n}{
+        \path (360/\n*\nr:\R) coordinate (i\nr);
+        \draw (M) -- (i\nr);
+    }
+    \draw (0:0.3*\R) arc (0:360/\n:0.3*\R);
+    \coordinate[label=right:$\alpha$] (Alpha) at ({2*360/(\n+2)}:0.1*\R);
+    \draw (i1) -- (i2) -- (i3) -- (i4) --(i5) -- (i6) -- cycle;
+
+    % Circle
+    \draw[green] (0,0) circle (\R);
+
+\end{tikzpicture}
+\end{document}

File diff suppressed because it is too large
+ 0 - 159
tikz/circular-sector-centroid/circular-sector-centroid.svg