8

This question actually has a connection to my other question that was posted yesterday.

The following figure illustrates the problem.

enter image description here

Shortly speaking, the cyan dot must always coincide with the yellow one.

\documentclass{article}
\usepackage{pstricks-add,multido}

\usepackage[active,tightpage]{preview}
\PreviewEnvironment{pspicture}
\PreviewBorder=0pt


\begin{document}
\multido{\i=0+10}{37}{
\begin{pspicture}(-2.5,-2.0)(2.5,2.0)
        \psframe*[linecolor=black](-2.5,-2.0)(2.5,2.0)
        \pstVerb{/theta \i\space def}%
        \pstVerb{/a 2.25 def}%
        \pstVerb{/b 1.75 def}%
    \ifnum\i=0
        % don't draw arc!
    \else
        \psellipticarc[linecolor=cyan]{-*}(0,0)(!a b){0}{!theta}
    \fi
    \psline[linecolor=yellow]{-*}(0,0)(!theta cos a mul theta sin b mul)
    \uput{5mm}[0](0,0){\color{white}\tiny \i}
\end{pspicture}}
\end{document}

Is it a bug in \psellipticarc or is my calculation wrong?

2 Answers2

7
\psellipticarc[linecolor=cyan,correctAngle=false]{-*}(0,0)(!a b){0}{!theta}

see section 3.4. Macro \psellipticarc in http://mirror.ctan.org/graphics/pstricks/base/doc/pst-news10.pdf

  • 1
    \psellipticarc[dimen=middle,linecolor=cyan,correctAngle=false]{-*}(0,0)(!a b){0}{!theta}, the default is dimen=outer –  Mar 11 '12 at 14:05
  • Your information has been applied to http://tex.stackexchange.com/a/47541/9467. Thanks a lot. – kiss my armpit Mar 11 '12 at 16:16
1

I just investigated that without changing the correctAngle to false we can still solve this issue as follows.

enter image description here

\documentclass[pstricks,border=0pt]{standalone}
\usepackage{pstricks-add}
\pstVerb
{
    /major 2.25 def
    /minor 1.75 def
    % b a t p2c ---> x y
    % where b (semi-minor), a (semi-major), t (theta)
    /p2c {dup 3 1 roll cos mul 3 1 roll sin mul} bind def
}

\psset{arrows=-*}

\begin{document}
\multido{\i=0+10}{37}
{
    \begin{pspicture}(-2.5,-2.0)(2.5,2.0)
        \ifnum\i=0
            % don't draw arc!
        \else
            \psellipticarc[linecolor=cyan,dimen=middle](!major minor){0}{(!minor major \i\space p2c)}%dimen=middle must be specified!
        \fi
        \psline[linecolor=red](!minor major \i\space p2c)
        \uput{5mm}[!\i\space 10 add](0,0){\tiny$\i^\circ$}
    \end{pspicture}
}
\end{document}