Advertisement
Guest User

Untitled

a guest
Jul 27th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. documentclass{amsart}
  2. usepackage{amsmath}
  3. usepackage{amsfonts}
  4.  
  5. usepackage{tikz}
  6. usetikzlibrary{calc,angles,positioning,intersections}
  7.  
  8.  
  9. begin{document}
  10.  
  11.  
  12. noindent hspace*{fill}
  13. begin{tikzpicture}[node distance= 3mm and 0mm]
  14.  
  15. %A hexagon - a set that is not convex - is drawn which is symmetric across the x-axis.
  16. coordinate (A) at (0,0);
  17. coordinate (O) at (-5,0);
  18.  
  19. path[name path=x-axis] (A) -- (O);
  20. path[name path=horizontal_line_at_-1] (-5,-1) -- (0,-1);
  21. path[name path=horizontal_line_at_1] (-5,1) -- (0,1);
  22.  
  23. coordinate (B) at ($(A) + (-135:2.5)$);
  24. draw (A) -- (B);
  25.  
  26. coordinate (C') at ($(B) + (165:3)$);
  27. path[name path=extension_of_line_segment_BC] (B) -- (C');
  28. coordinate[name intersections={of=extension_of_line_segment_BC and horizontal_line_at_-1, by={C}}];
  29. draw (B) -- (C);
  30.  
  31. coordinate (D') at ($(C) + (45:2)$);
  32. path[name path=extension_of_line_segment_CD] (C) -- (D');
  33. coordinate[name intersections={of=extension_of_line_segment_CD and x-axis, by={D}}];
  34. draw (C) -- (D);
  35.  
  36. coordinate (E') at ($(D) + (135:2)$);
  37. path[name path=extension_of_line_segment_DE] (D) -- (E');
  38. coordinate[name intersections={of=extension_of_line_segment_DE and horizontal_line_at_1, by={E}}];
  39. draw (D) -- (E);
  40.  
  41. coordinate (F) at ($(E) + (15:3)$);
  42. draw (E) -- (F);
  43. draw (A) -- (F);
  44.  
  45.  
  46. %Points P and Q in the hexagon are plotted. Line segment $overline{PQ}$ is not contained in the
  47. %hexagon.
  48. coordinate (P) at (-4,0.75);
  49. draw[fill] (P) circle (1.5pt);
  50. coordinate (Q) at (-4,-0.75);
  51. draw[fill] (Q) circle (1.5pt);
  52. draw (P) -- (Q);
  53. %Points P and Q are labeled.
  54. coordinate (label_for_P) at ($(P)!-3mm!-90:(Q)$);
  55. node at (label_for_P){$P$};
  56. coordinate (label_for_Q) at ($(Q)!-3mm!90:(P)$);
  57. node at (label_for_Q){$Q$};
  58.  
  59. %Title for hexagon is typeset.
  60. node[font=bfseries,align=center,above=of F -| {$(C |- A)!0.5!(A)$}] (title) {A set that is \ not convex};
  61.  
  62.  
  63. %A convex pentagon is drawn which is symmetric across the x-axis.
  64. begin{scope}[transform canvas={xshift=6cm}]
  65. coordinate (A) at (0,0);
  66. coordinate (O) at (-5,0);
  67.  
  68. path[name path=x-axis] (A) -- (O);
  69. path[name path=horizontal_line_at_-1] (-5,-1) -- (0,-1);
  70. path[name path=horizontal_line_at_1] (-5,1) -- (0,1);
  71.  
  72. coordinate (B) at ($(A) + (-135:2.5)$);
  73. draw (A) -- (B);
  74.  
  75. coordinate (C') at ($(B) + (165:3)$);
  76. path[name path=extension_of_line_segment_BC] (B) -- (C');
  77. coordinate[name intersections={of=extension_of_line_segment_BC and horizontal_line_at_-1, by={C}}];
  78. draw (B) -- (C);
  79.  
  80. coordinate (D') at ($(C) + (45:2)$);
  81. path[name path=extension_of_line_segment_CD] (C) -- (D');
  82. coordinate[name intersections={of=extension_of_line_segment_CD and x-axis, by={D}}];
  83. draw[dashed] (C) -- (D);
  84.  
  85. coordinate (E') at ($(D) + (135:2)$);
  86. path[name path=extension_of_line_segment_DE] (D) -- (E');
  87. coordinate[name intersections={of=extension_of_line_segment_DE and horizontal_line_at_1, by={E}}];
  88. draw[dashed] (D) -- (E);
  89.  
  90. draw (C) -- (E);
  91.  
  92. coordinate (F) at ($(E) + (15:3)$);
  93. draw (E) -- (F);
  94. draw (A) -- (F);
  95.  
  96. %Title for pentagon is typeset.
  97. node[font=bfseries, above=of E -| {$(C |- A)!0.5!(A)$}] (title) {A convex set};
  98. end{scope}
  99. end{tikzpicture}
  100. hspace{fill}
  101.  
  102. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement