还有其他方法可以创建等距线段的螺旋吗?

还有其他方法可以创建等距线段的螺旋吗?

我想创建一个由等距线段组成的螺旋,如下图所示。我尝试用各种方法绘制它。使用颜色来区分每种方法。

在此处输入图片描述

我使用的方法是:

\translate(!CP \tx@UserCoor)\multido\lineto

这是我原来的想法。

\makeatletter
\begin{pspicture}[showgrid](-5,-5)(5,5)
\pscustom[linecolor=red]
{
    \moveto(0,0)
    \multido{\r=0.1+0.1}{89}{\translate(!CP \tx@UserCoor)\lineto(!1 \r\space sqrt 700 mul PtoC)}
}
\end{pspicture}
\makeatother

\translate(!CP \tx@UserCoor)\multido\psline

这是我原来的想法。

\makeatletter
\begin{pspicture}[showgrid](-5,-5)(5,5)
\pscustom[linecolor=green]
{
    \moveto(0,0)
    \multido{\r=0.1+0.1}{89}{\translate(!CP \tx@UserCoor)\psline(!1 \r\space sqrt 700 mul PtoC)}
}
\end{pspicture}
\makeatother

\rlineto\multido

这是我原来的想法。

\begin{pspicture}[showgrid](-5,-5)(5,5)
\pscustom[linecolor=blue]
{
    \moveto(0,0)
    \multido{\r=0.1+0.1}{89}{\rlineto(!1 \r\space sqrt 700 mul PtoC)}
}
\end{pspicture}

\psVector\multido

这是赫伯特的主意。

\begin{pspicture}[showgrid](-5,-5)(5,5)
    \psset{showpoints,dotstyle=o,dotscale=2,linecolor=red}
    \psStartPoint(0,0)
    \multido{\r=0.1+0.1}{89}{\psVector[arrows=-](!1 \r\space sqrt 700 mul PtoC)}
\end{pspicture}

\psnline\multido,连接\points\expandafter

这是杰克的主意。

\begin{pspicture}[showgrid](-5,-5)(5,5)
\def\points{(0,0)}%
\multido{\r=0.1+0.1}{89}{\xdef\points{\points(!1 \r\space sqrt 700 mul PtoC)}}
\psset{linecolor=green}
\expandafter\psrline\points
\end{pspicture}

\curvepnodes使用临时变量

这是克里斯托弗的主意。

\begin{pspicture}[showgrid](-5,-5)(5,5)
  \pstVerb{tx@NodeDict begin /myX -1 def /myY 0 def end }%
  \curvepnodes[plotpoints=90]{0}{89}{%
    myX myY
    t 0.1 mul sqrt 700 mul 1 exch PtoC
    3 -1 roll add 3 1 roll add exch
    2 copy /myY ED /myX ED
  }{P}
  \psnline[linecolor=blue](0,\Pnodecount){P} 
\end{pspicture}

\psparametricplot使用临时变量

这是克里斯托弗的想法的应用\psparametricplot

\begin{pspicture}[showgrid](-5,-5)(5,5)
  \pstVerb{/myX -1 def /myY 0 def}%
  \psparametricplot[plotpoints=90,linecolor=red]{0}{89}{%
    myX myY
    t 0.1 mul sqrt 700 mul 1 exch PtoC
    3 -1 roll add 3 1 roll add exch
    2 copy /myY ED /myX ED
  }
\end{pspicture}

\curvepnodesfor

这是克里斯托弗的主意。

\begin{pspicture}[showgrid](-5,-5)(5,5)
  \curvepnodes[plotpoints=90]{0}{89}{%
    -1 0 
        0 1 t
        {
            0.1 mul sqrt 700 mul 1 exch PtoC
            3 -1 roll add 3 1 roll add exch
    } for 
  }{P}
  \psnline[linecolor=green](0,\Pnodecount){P} 
\end{pspicture}

\psparametricplotfor

这是克里斯托弗的想法的应用\psparametricplot

\begin{pspicture}[showgrid](-5,-5)(5,5)
  \psparametricplot[plotpoints=90,linecolor=blue]{0}{89}{%
    -1 0 
        0 1 t
        {
            0.1 mul sqrt 700 mul 1 exch PtoC
            3 -1 roll add 3 1 roll add exch
    } for 
  } 
\end{pspicture}

完整代码

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pstricks-add}
\psset{showpoints,dotstyle=o,dotscale=2}

\begin{document}


\makeatletter
\begin{pspicture}[showgrid](-5,-5)(5,5)
\pscustom[linecolor=red]
{
    \moveto(0,0)
    \multido{\r=0.1+0.1}{89}{\translate(!CP \tx@UserCoor)\lineto(!1 \r\space sqrt 700 mul PtoC)}
}
\end{pspicture}
\makeatother



\makeatletter
\begin{pspicture}[showgrid](-5,-5)(5,5)
\pscustom[linecolor=green]
{
    \moveto(0,0)
    \multido{\r=0.1+0.1}{89}{\translate(!CP \tx@UserCoor)\psline(!1 \r\space sqrt 700 mul PtoC)}
}
\end{pspicture}
\makeatother


\begin{pspicture}[showgrid](-5,-5)(5,5)
\pscustom[linecolor=blue]
{
    \moveto(0,0)
    \multido{\r=0.1+0.1}{89}{\rlineto(!1 \r\space sqrt 700 mul PtoC)}
}
\end{pspicture}


\begin{pspicture}[showgrid](-5,-5)(5,5)
    \psset{showpoints,dotstyle=o,dotscale=2,linecolor=red}
    \psStartPoint(0,0)
    \multido{\r=0.1+0.1}{89}{\psVector[arrows=-](!1 \r\space sqrt 700 mul PtoC)}
\end{pspicture}


\begin{pspicture}[showgrid](-5,-5)(5,5)
\def\points{(0,0)}%
\multido{\r=0.1+0.1}{89}{\xdef\points{\points(!1 \r\space sqrt 700 mul PtoC)}}
\psset{linecolor=green}
\expandafter\psrline\points
\end{pspicture}


\begin{pspicture}[showgrid](-5,-5)(5,5)
  \pstVerb{tx@NodeDict begin /myX -1 def /myY 0 def end }%
  \curvepnodes[plotpoints=90]{0}{89}{%
    myX myY
    t 0.1 mul sqrt 700 mul 1 exch PtoC
    3 -1 roll add 3 1 roll add exch
    2 copy /myY ED /myX ED
  }{P}
  \psnline[linecolor=blue](0,\Pnodecount){P} 
\end{pspicture}

\begin{pspicture}[showgrid](-5,-5)(5,5)
  \pstVerb{/myX -1 def /myY 0 def}%
  \psparametricplot[plotpoints=90,linecolor=red]{0}{89}{%
    myX myY
    t 0.1 mul sqrt 700 mul 1 exch PtoC
    3 -1 roll add 3 1 roll add exch
    2 copy /myY ED /myX ED
  }
\end{pspicture}

\begin{pspicture}[showgrid](-5,-5)(5,5)
  \curvepnodes[plotpoints=90]{0}{89}{%
    -1 0 
        0 1 t
        {
            0.1 mul sqrt 700 mul 1 exch PtoC
            3 -1 roll add 3 1 roll add exch
    } for 
  }{P}
  \psnline[linecolor=green](0,\Pnodecount){P} 
\end{pspicture}

\begin{pspicture}[showgrid](-5,-5)(5,5)
  \psparametricplot[plotpoints=90,linecolor=blue]{0}{89}{%
    -1 0 
        0 1 t
        {
            0.1 mul sqrt 700 mul 1 exch PtoC
            3 -1 roll add 3 1 roll add exch
    } for 
  } 
\end{pspicture}

\end{document}

问题

  1. 这里该如何使用\psplot

  2. 还有其他方法吗?

  3. 当使用\lineto\psline和 时\rlineto,如何使其showpoints起作用?

相关内容