一

在左侧范围内,如何自动将红色圆圈沿第三个蓝色圆圈均匀分布,而不是手动绘制和移动它们;并使第三个圆圈不可见(白色)。

在正确的范围内,如何将红色圆圈聚集在某个点周围,并控制它们之间的距离,以制作第二幅和第三幅图画。

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{bias}
\begin{minipage}{\textwidth}
{
\tikzset{pics/.cd,cc/.style={code={\draw [red, thin, fill=red] circle (0.248cm);}}}
\begin{tikzpicture}[scale=.9, transform shape]
\begin{scope}[scale=.4]
\draw[black, thick, fill=black] (0,0)node (o){} circle (0.24cm);
\draw[black, thick, dashdotted] ([shift={(-90.:5.4cm)}]o.center) -- ([shift={(90.:5.4cm)}]o.center) ([shift={(180.:5.4cm)}]o.center) -- ([shift={(0.:5.4cm)}]o.center);
\foreach \r in {1, 2,2.5,3,4,5} \draw[blue, thick] (o.center) circle (\r);
\pic at ([shift={(-90.:2.4cm)}]o.center) {cc};
\pic at ([shift={(90.:2.4cm)}]o.center) {cc};
\pic at ([shift={(170.:2.48cm)}]o.center) {cc};
\pic at ([shift={(10.:2.48cm)}]o.center) {cc};
\pic at ([shift={(45.:2.48cm)}]o.center) {cc};
\pic at ([shift={(-45.:2.48cm)}]o.center) {cc};
\pic at ([shift={(135.:2.48cm)}]o.center) {cc};
\pic at ([shift={(-135.:2.48cm)}]o.center) {cc};
\end{scope}
\begin{scope}[scale=.4, xshift=14cm]
\draw[black, thick, fill=black] (0,0)node (o){} circle (0.24cm);
\draw[black, thick, dashdotted] ([shift={(-90.:5.4cm)}]o.center) -- ([shift={(90.:5.4cm)}]o.center) ([shift={(180.:5.4cm)}]o.center) -- ([shift={(0.:5.4cm)}]o.center);
\foreach \r in {1, 2,...,5} \draw[blue, thick] (o.center) circle (\r);
\pic at ([shift={(145.:2.48cm)}]o.center) {cc};
\pic at ([shift={(156.:2.4cm)}]o.center) {cc};
\pic at ([shift={(145.:3.cm)}]o.center) {cc};
\pic at ([shift={(150.:3.6cm)}]o.center) {cc};
 \pic at ([shift={(159.:3.6cm)}]o.center) {cc};
\pic at ([shift={(168.:2.48cm)}]o.center) {cc};
\pic at ([shift={(168.:3.6cm)}]o.center) {cc};
\pic at ([shift={(168.:3.06cm)}]o.center) {cc};
\end{scope}
\end{tikzpicture}
}
\end{minipage}
\end{frame}
\end{document}

在此处输入图片描述

在此处输入图片描述

答案1

这就是你要找的吗?

在此处输入图片描述

\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\begin{document}
\tikzset{pics/.cd,cc/.style={code={\draw [black, thin, fill=red] circle (0.248cm);}}}
\begin{tikzpicture}[scale=.9, transform shape]
\begin{scope}[scale=.4]
\draw[black, thick, fill=black] (0,0)node (o){} circle (0.24cm);
\draw[black, thick, dashdotted] ([shift={(-90.:5.4cm)}]o.center) -- ([shift={(90.:5.4cm)}]o.center) ([shift={(180.:5.4cm)}]o.center) -- ([shift={(0.:5.4cm)}]o.center);
\foreach \r in {1, 2,3,4,5} \draw[blue, thick] (o.center) circle (\r);
\foreach \ang in {0,45,...,315}
    \pic at (\ang:2.5cm) {cc};
\end{scope}
\begin{scope}[scale=.4, xshift=14cm]
\draw[black, thick, fill=black] (0,0)node (o){} circle (0.24cm);
\draw[black, thick, dashdotted] ([shift={(-90.:5.4cm)}]o.center) -- ([shift={(90.:5.4cm)}]o.center) ([shift={(180.:5.4cm)}]o.center) -- ([shift={(0.:5.4cm)}]o.center);
\foreach \r in {1, 2,...,5} \draw[blue, thick] (o.center) circle (\r);
\def\dist{0.7}
\coordinate (p) at (240:3cm);
\foreach \ang in {0,45,...,315}
    \pic at ([shift={(\ang:\dist)}]p) {cc};
\end{scope}
\end{tikzpicture}
\end{document}

答案2

PSTricks 解决方案仅用于比较目的。

\documentclass[pstricks,border=12pt]{standalone}
\pstVerb{realtime srand}
\begin{document}
\begin{pspicture}(-6,-6)(6,6)
    \qdisk(0,0){5pt}
    \foreach \i in {1,...,6}{\pscircle[linecolor=blue]{\i}}
    \foreach \i in {0,1,...,7}{\pscircle[fillstyle=solid,fillcolor=red,origin={!3 45 \i\space mul PtoC}]{5pt}}
    \psset{linestyle=dashed}    
    \psline(0,-6)(0,6)
    \psline(-6,0)(6,0)
\end{pspicture}
\end{document}

在此处输入图片描述

\documentclass[pstricks,border=12pt]{standalone}
\pstVerb{realtime srand}
\begin{document}
\begin{pspicture}(-6,-6)(6,6)
    \qdisk(0,0){5pt}
    \foreach \i in {1,...,6}{\pscircle[linecolor=blue]{\i}}
    \psLoop{8}{\pscircle[fillstyle=solid,fillcolor=red,origin={-3,-2}](!Rand .5 mul Rand 360 mul PtoC){5pt}}
    \psset{linestyle=dashed}    
    \psline(0,-6)(0,6)
    \psline(-6,0)(6,0)
\end{pspicture}
\end{document}

在此处输入图片描述

\documentclass[pstricks,border=12pt]{standalone}
\pstVerb{realtime srand}
\begin{document}
\begin{pspicture}(-6,-6)(6,6)
    \qdisk(0,0){5pt}
    \foreach \i in {1,...,6}{\pscircle[linecolor=blue]{\i}}
    \foreach \i in {0,1,...,7}{\pscircle[fillstyle=solid,fillcolor=red,origin={3;225}](!.5 45 \i\space mul PtoC){5pt}}
    \psset{linestyle=dashed}    
    \psline(0,-6)(0,6)
    \psline(-6,0)(6,0)
\end{pspicture}
\end{document}

在此处输入图片描述

相关内容