Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
1  
I see two triangles and a \draw (a)--(q)--.....(p); –  percusse Aug 3 at 14:35
    
Is G isobarycenter of the six points or common isobarycenter of the two triangles ? –  Tarass Aug 3 at 16:49
    
Sorry to bother you. I know that you have up-voted answers and that is great! However, you still haven't accepted any answer (a different action from up-voting). Please consider revisiting your questions and, for each one, accepting the answer that you consider best solved your problem. In case of doubt, please see How do you accept an answer?. –  Gonzalo Medina Aug 4 at 18:04

2 Answers 2

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

share|improve this answer
1  
If all the barycentric factors are equal they allso could be 1. ;-) –  Tarass Aug 3 at 16:47

Just for typing exercise with PSTricks. The point G is the centroid of the outer most polygon.

\documentclass[pstricks,border=24pt,12pt]{standalone}
\usepackage{pst-eucl}

\begin{document}
\begin{pspicture}[showgrid=false](6,6)
    \pstGeonode[PosAngle={180,90,45,0,-45,-135},CurveType=polygon,linestyle=dotted,dotsep=0.4pt]
        (0,3){a}
        (3,6){p}        
        (5,5){c}            
        (6,3){r}    
        (5.5,1){b}
        (1,0){q}
    \nodexn{(a)+(b)+(c)+(p)+(q)+(r)}{g}
    \pstGeonode(!\psGetNodeCenter{g} g.x 6 div g.y 6 div){G}
    \pspolygon(a)(b)(c)
    \pspolygon[linestyle=dashed](p)(q)(r)
    \foreach \pt in {a,b,c,p,q,r}{\psset{fillcolor=white,fillstyle=solid}\pscircle(\pt){2pt}}
\end{pspicture}
\end{document}

enter image description here

share|improve this answer
    
This is not an answer to the question posted, though. –  cfr Aug 3 at 19:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.