[Tex/LaTex] How to draw a star like shape with Tikz

tikz-pgf

How do you draw a star like shape using Tikz, like the shape below
Star like shape

Best Answer

One option; the barycentric coordinate system was used to position the node "G":

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\draw[dotted]
  (0,0) coordinate (A) --
  (4,1) coordinate (B) --
  (4.5,2) coordinate (C) -- 
  (3.8,3) coordinate (D) --
  (1.6,4) coordinate (E) --
  (-1,1.5) coordinate (F) --
  cycle;
\draw[thick] 
  (B) -- (D) -- (F) -- cycle;
\draw[dashed] 
  (A) -- (C) -- (E) -- cycle;
\foreach \Coor/\Texto/\Pos in 
  {A/q/below,
  B/b/below,
  C/r/right,
  D/c/right,
  E/p/above,
  F/a/left%
  }
  \node[circle,draw,inner sep=1.5pt,fill=white,label={\Pos:$\Texto$}] 
  at (\Coor) {};
  \node[fill,circle,inner sep=1.5pt,label={right:$G$}] 
  at (barycentric cs:A=0.5,B=0.5,C=0.5,D=0.5,E=0.5,F=0.5) {};  
\end{tikzpicture}

\end{document}

enter image description here

Related Question