瀏覽代碼

Improve quality of image

Martin Thoma 9 年之前
父節點
當前提交
2042a162f3

+ 3 - 1
tikz/polygon-is-point-inside/Makefile

@@ -28,4 +28,6 @@ svg:
 	#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
+	inkscape $(SOURCE).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

二進制
tikz/polygon-is-point-inside/polygon-is-point-inside.png


+ 17 - 11
tikz/polygon-is-point-inside/polygon-is-point-inside.tex

@@ -3,7 +3,7 @@
 \usetikzlibrary{shapes.geometric,positioning,calc,shapes.misc}
 
 \begin{document}
-    \tikzstyle{polygon}=[very thick, fill=orange!25]
+    \tikzstyle{polygon}=[very thick]
     \tikzstyle{point}=[ultra thick,draw=gray,cross out,inner sep=0pt,minimum width=4pt,minimum height=4pt,]
     \tikzstyle{line}=[red]
     \begin{tikzpicture}
@@ -11,21 +11,27 @@
         \coordinate[label=right:$B$] (B) at (3,0);
         \coordinate[label=right:$C$] (C) at (4,2);
         \coordinate[label=above:$D$] (D) at (3,4);
-        \coordinate[label={[label distance=0.5cm]90:$E$}] (E) at (2,2);
+        \coordinate[label={[label distance=0.5cm]270:$E$}] (E) at (2,2);
         \coordinate[label=above:$F$] (F) at (1,4);
         \coordinate[label=left:$G$] (G) at (0,2);
 
 
-        \draw[polygon] (A) -- (B) -- (C) -- (D) -- (E) -- (F) -- (G) -- cycle;
+        \draw[polygon, fill=orange!25] (A) -- (B) -- (C) -- (D) -- (E) -- (F) -- (G) -- cycle;
+
+        \coordinate[label={[label distance=0.05cm]270:$E$}] (E) at (2,2);
+
+        \node (P) [point]   at  (2,3.5) {};
 
-        \node (P) [point, label={[right]{$P$}}]   at  (2,3.5) {};
+        \draw[line] (P.center) -- (A);
+        \draw[line] (P.center) -- (B);
+        \draw[line] (P.center) -- (C);
+        \draw[line] (P.center) -- (D);
+        \draw[line] (P.center) -- (E);
+        \draw[line] (P.center) -- (F);
+        \draw[line] (P.center) -- (G);
 
-        \draw[line] (P) -- (A);
-        \draw[line] (P) -- (B);
-        \draw[line] (P) -- (C);
-        \draw[line] (P) -- (D);
-        \draw[line] (P) -- (E);
-        \draw[line] (P) -- (F);
-        \draw[line] (P) -- (G);
+        \node (P) [point, label={[above]{$P$}}]   at  (2,3.5) {};
+
+        \draw[polygon] (A) -- (B) -- (C) -- (D) -- (E) -- (F) -- (G) -- cycle;
     \end{tikzpicture}
 \end{document}