如何绘制 epsilon-net

如何绘制 epsilon-net

如何绘制以下图表

在此处输入图片描述

对于完全有界集,这是一个相互连接的六边形网,覆盖在有界集中绘制的相同集合。

答案1

可能像这样吗?

\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}[font=\sffamily,pics/hexi/.style={code={
    \draw[pic actions]
    plot[samples at={0,60,...,300},variable=\x]
  (\x:1) -- cycle;}},
  declare function={rrnd(\x)=2.2+0.2*rnd+0.5*cos(2*\x);}]
  \path[scale=0.6,transform shape] foreach \X 
    [evaluate=\X as \Ymin using {int( (\X<3 || \X>5) ? 2 + (\X==8) :1 + (\X==4))},
    evaluate=\X as \Ymax using {int( (\X==1 || \X>6) ? 4 - (\X==1) :5)}] in {1,...,8} {
 foreach \Y in {\Ymin,...,\Ymax} { 
 \ifodd\X 
  ({\X*(1+cos(60))},{\Y*(2*sin(60))})
 \else
  ({\X*(1+cos(60))},{\Y*(2*sin(60))-sin(60)})
 \fi pic{hexi}}};
 \pgfmathsetseed{137}
 \draw[thick,shift={(4,3)}]  plot[smooth cycle,samples at={0,30,...,330}]
  (\x:{rrnd(\x)});
 \path (4,-0.5) node[below]{Totally bounded}; 
 % 
 \pgfmathsetseed{137}
 \draw[thick,shift={(-4,3)}]  plot[smooth cycle,samples at={0,30,...,330}]
  (\x:{rrnd(\x)});
 \path (-4,-0.5) node[below]{Bounded}; 
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容