瀏覽代碼

Add tikz/triangle-unit-circle

Martin Thoma 10 年之前
父節點
當前提交
f40aea745e

+ 33 - 0
tikz/triangle-unit-circle/Makefile

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

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

二進制
tikz/triangle-unit-circle/triangle-unit-circle.png


+ 48 - 0
tikz/triangle-unit-circle/triangle-unit-circle.tex

@@ -0,0 +1,48 @@
+\documentclass{article}
+\usepackage[pdftex,active,tightpage]{preview}
+\setlength\PreviewBorder{2mm}
+\usepackage{tikz}
+\usetikzlibrary{backgrounds}
+\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,x=3cm,y=3cm,  show background rectangle,
+  background rectangle/.style={fill=white},]
+    \tkzInit[xmax=1.0,ymax=1.0,xmin=-1.0,ymin=-1.0]
+    \tkzGrid
+    \tkzAxeXY[up space=0.2,right space=0.2,fill=none]
+
+    \tkzDefPoint(0,0){A}
+    \tkzDefPoint({cos(FPpi/5)*1},0){B}
+    \tkzDefPoint({cos(FPpi/5)*1},{sin(FPpi/5)*1}){C}
+    \tkzDefPoint(1,0){CircleEnd}
+
+    \tkzDrawCircle(A,CircleEnd)
+
+    % \tkzLabelPoints[below left,font=\sansmath\sffamily](A)
+    % \tkzLabelPoints[below right,font=\sansmath\sffamily](B)
+
+    % Mark angle
+    \tkzMarkAngle[arc=l,size=0.6cm,fill=green!30](B,A,C)
+    \tkzLabelAngle[pos=0.15](B,A,C){$\alpha$}
+
+    % Draw polygon
+    \tkzDrawPolygon(A,B,C)
+    \tkzDrawSegment[black!60!green,very thick](A,B)
+    \tkzDrawSegment[red,very thick](B,C)
+
+    % Label lines
+    \tkzLabelSegment[above](A,C){$1$}
+    \tkzLabelSegment[sloped,above=-0.05,red](B,C){$\sin(\alpha)$}
+    \tkzLabelSegment[below,black!60!green](A,B){$\cos(\alpha)$}
+\end{tikzpicture}
+\end{preview}
+\end{document}