使用字符绘制圆圈

使用字符绘制圆圈

我正在尝试使用加号和减号绘制圆弧来绘制单位圆。我正在教我的学生测角不等式。我正在使用参数图绘制圆弧,但我无法绘制 +/-。最好选择符号的密度并旋转符号以跟随圆弧。有人能帮助我吗?

答案1

我上面的评论风格很容易重复。例如,要沿单位圆有 17 个加号,你只需要说

\draw[repeat along closed path={17}{+}]  (0,0) circle[radius=1cm];

即第一个参数是重复的次数,第二个参数是要重复的符号(或符号)。

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{decorations.text}
\newcounter{pft}
\newcommand{\Repeat}[3]{\setcounter{pft}{1}%
\edef#3{#2}%
\loop\stepcounter{pft}\edef#3{#3#2}\ifnum\value{pft}<#1\repeat}
\begin{document}
\begin{tikzpicture}[repeat along path/.style 2 args={
 /utils/exec=\Repeat{#1}{#2}{\mytext},
 decorate,decoration={text along path,text={{}\mytext{}},
 text align=fit to path}},
 repeat along closed path/.style 2 args={
 /utils/exec=\Repeat{#1}{#2}{\mytext},
 decorate,decoration={text along path,text={\mytext{}},
 text align=fit to path}}]
 \draw[repeat along closed path={17}{+}]  (0,0) circle[radius=1cm];
 \draw[repeat along path={9}{-},/pgf/decoration/raise=-3pt] (2,0) arc(-180:0:1);
 \draw[repeat along path={9}{+}] (2,0) arc(180:0:1);
 \draw[repeat along closed path={9}{+-}]  (6,0) circle[radius=1cm];
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

为了好玩:这很容易pstricks

\documentclass[svgnames, x11names, border=3pt]{standalone}
\usepackage{pst-plot, multido}
\usepackage{auto-pst-pdf}

\begin{document}

\begin{pspicture*}(-2.5,-2.5)(2.5,2.8)
\psset{algebraic, arrowinset=0.125, arrowsize=3pt, linejoin=1}
\psaxes[linecolor=OrangeRed2! 80, ticks=none, labels=none, arrows =-> ](0,0)(-2.5,-2.5)(2.5,2.8) [$x$,-135] [$y$,-135]
\uput[dl](0,0){$O$}
\psset{linewidth=1.5pt, linecolor=DarkOliveGreen3, plotpoints=100,dotstyle= + }
\multido{\iangle= 0+9}{21}{\psdot[dotstyle=+](2;\iangle)}
\multido{\iangle= 189+9}{19}{\psdot[dotstyle=|, dotangle=90, linecolor=Gold](2;\iangle)}

\end{pspicture*}

\end{document} 

在此处输入图片描述

相关内容