Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{amsart}
- usepackage{amsmath}
- usepackage{amsfonts}
- usepackage{tikz}
- usetikzlibrary{calc,angles,positioning,intersections}
- begin{document}
- noindent hspace*{fill}
- begin{tikzpicture}[node distance= 3mm and 0mm]
- %A hexagon - a set that is not convex - is drawn which is symmetric across the x-axis.
- coordinate (A) at (0,0);
- coordinate (O) at (-5,0);
- path[name path=x-axis] (A) -- (O);
- path[name path=horizontal_line_at_-1] (-5,-1) -- (0,-1);
- path[name path=horizontal_line_at_1] (-5,1) -- (0,1);
- coordinate (B) at ($(A) + (-135:2.5)$);
- draw (A) -- (B);
- coordinate (C') at ($(B) + (165:3)$);
- path[name path=extension_of_line_segment_BC] (B) -- (C');
- coordinate[name intersections={of=extension_of_line_segment_BC and horizontal_line_at_-1, by={C}}];
- draw (B) -- (C);
- coordinate (D') at ($(C) + (45:2)$);
- path[name path=extension_of_line_segment_CD] (C) -- (D');
- coordinate[name intersections={of=extension_of_line_segment_CD and x-axis, by={D}}];
- draw (C) -- (D);
- coordinate (E') at ($(D) + (135:2)$);
- path[name path=extension_of_line_segment_DE] (D) -- (E');
- coordinate[name intersections={of=extension_of_line_segment_DE and horizontal_line_at_1, by={E}}];
- draw (D) -- (E);
- coordinate (F) at ($(E) + (15:3)$);
- draw (E) -- (F);
- draw (A) -- (F);
- %Points P and Q in the hexagon are plotted. Line segment $overline{PQ}$ is not contained in the
- %hexagon.
- coordinate (P) at (-4,0.75);
- draw[fill] (P) circle (1.5pt);
- coordinate (Q) at (-4,-0.75);
- draw[fill] (Q) circle (1.5pt);
- draw (P) -- (Q);
- %Points P and Q are labeled.
- coordinate (label_for_P) at ($(P)!-3mm!-90:(Q)$);
- node at (label_for_P){$P$};
- coordinate (label_for_Q) at ($(Q)!-3mm!90:(P)$);
- node at (label_for_Q){$Q$};
- %Title for hexagon is typeset.
- node[font=bfseries,align=center,above=of F -| {$(C |- A)!0.5!(A)$}] (title) {A set that is \ not convex};
- %A convex pentagon is drawn which is symmetric across the x-axis.
- begin{scope}[transform canvas={xshift=6cm}]
- coordinate (A) at (0,0);
- coordinate (O) at (-5,0);
- path[name path=x-axis] (A) -- (O);
- path[name path=horizontal_line_at_-1] (-5,-1) -- (0,-1);
- path[name path=horizontal_line_at_1] (-5,1) -- (0,1);
- coordinate (B) at ($(A) + (-135:2.5)$);
- draw (A) -- (B);
- coordinate (C') at ($(B) + (165:3)$);
- path[name path=extension_of_line_segment_BC] (B) -- (C');
- coordinate[name intersections={of=extension_of_line_segment_BC and horizontal_line_at_-1, by={C}}];
- draw (B) -- (C);
- coordinate (D') at ($(C) + (45:2)$);
- path[name path=extension_of_line_segment_CD] (C) -- (D');
- coordinate[name intersections={of=extension_of_line_segment_CD and x-axis, by={D}}];
- draw[dashed] (C) -- (D);
- coordinate (E') at ($(D) + (135:2)$);
- path[name path=extension_of_line_segment_DE] (D) -- (E');
- coordinate[name intersections={of=extension_of_line_segment_DE and horizontal_line_at_1, by={E}}];
- draw[dashed] (D) -- (E);
- draw (C) -- (E);
- coordinate (F) at ($(E) + (15:3)$);
- draw (E) -- (F);
- draw (A) -- (F);
- %Title for pentagon is typeset.
- node[font=bfseries, above=of E -| {$(C |- A)!0.5!(A)$}] (title) {A convex set};
- end{scope}
- end{tikzpicture}
- hspace{fill}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement