浏览代码

added Robot yaw

Martin Thoma 11 年之前
父节点
当前提交
8d2b71adae
共有 4 个文件被更改,包括 65 次插入0 次删除
  1. 35 0
      tikz/robot-yaw/Makefile
  2. 3 0
      tikz/robot-yaw/Readme.md
  3. 二进制
      tikz/robot-yaw/robot-yaw.png
  4. 27 0
      tikz/robot-yaw/robot-yaw.tex

+ 35 - 0
tikz/robot-yaw/Makefile

@@ -0,0 +1,35 @@
+SOURCE = robot-yaw
+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/robot-yaw/Readme.md

@@ -0,0 +1,3 @@
+Compiled example
+----------------
+![Example](robot-yaw.png)

二进制
tikz/robot-yaw/robot-yaw.png


+ 27 - 0
tikz/robot-yaw/robot-yaw.tex

@@ -0,0 +1,27 @@
+\documentclass{article}
+\usepackage[pdftex,active,tightpage]{preview}
+\setlength\PreviewBorder{2mm}
+\usepackage{amsmath,amssymb}
+\usepackage{tikz}
+\usetikzlibrary{calc} 
+\begin{document}
+\begin{preview}
+\begin{tikzpicture}
+    \newcommand\angleR{35}
+    \newcommand\radiusR{4cm}
+
+    \coordinate[label=below left:$O$] (O) at (0,0);
+    \draw[->,very thick] (0,0)--(0,5) node[above] {$x$};
+    \draw[->,very thick] (0,0)--(-2.5,0) node[left] {$y$};
+    \node at (90+15:\radiusR+0.5cm) {$\alpha > 0$};
+    \node at (90-15:\radiusR+0.5cm) {$\alpha < 0$};
+    \draw[fill=orange!30] (-1,-1) rectangle (1,2);
+    \draw[fill=blue!30] (0,2) circle (0.3cm);
+
+    % Draw angle
+    \begin{scope}[shift={(0,0)}]
+        \draw[thick, <->] ([shift={({90+\angleR}:\radiusR)}]-0.0,0) arc ({90+\angleR}:{90-\angleR}:\radiusR);
+    \end{scope}
+\end{tikzpicture}
+\end{preview}
+\end{document}