2

A node A will be constructed by using 2 syntax.

  • \pnode(!2 3 0 p2c exch 3 add exch 2 add){A}
  • \pnode[3,2](!2 3 0 p2c){A}

Each constructs the node A by translating a point (!2 3 0 p2c) (which is on an basic ellipse) 3 unit rightward and 2 unit upward.

First Syntax

\pnode(!2 3 0 p2c exch 3 add exch 2 add){A}

And the output is as follows.

enter image description here

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pstricks-add}
\pstVerb{/p2c {dup 3 1 roll cos mul 3 1 roll sin mul} bind def}% b a t p2c --> x y
\begin{document}

\begin{pspicture}[showgrid=bottom](6,4)
    \pnode(3,2){center}
    \pnode(!2 3 0 p2c exch 3 add exch 2 add){A}
    \pnode(!2 3 0 p2c exch 3 add exch 2 add){B}
    \pscustom[origin={center},fillstyle=solid,fillcolor=cyan]
    {
        \psellipticarc(center)(3,2){(A)}{(B)}
        \lineto(center)
        \closepath
    }   
\end{pspicture}

\end{document}

Second Syntax

\pnode[3,2](!2 3 0 p2c){A}

And the output is as follows.

enter image description here

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pstricks-add}
\pstVerb{/p2c {dup 3 1 roll cos mul 3 1 roll sin mul} bind def}% b a t p2c --> x y
\begin{document}

\begin{pspicture}[showgrid=bottom](6,4)
    \pnode(3,2){center}
    \pnode[3,2](!2 3 0 p2c){A}
    \pnode(!2 3 0 p2c exch 3 add exch 2 add){B}
    \pscustom[origin={center},fillstyle=solid,fillcolor=cyan]
    {
        \psellipticarc(center)(3,2){(A)}{(B)}
        \lineto(center)
        \closepath
    }   
\end{pspicture}

\end{document}

Why are the outputs different?

Edit:

I noticed that the problem will be fixed only if both A and B are expressed in the same syntax, either

    \pnode(!2 3 0 p2c exch 3 add exch 2 add){A}
    \pnode(!2 3 0 p2c exch 3 add exch 2 add){B}

or

    \pnode[3,2](!2 3 0 p2c){A}
    \pnode[3,2](!2 3 0 p2c){B}

But I still don't understand why the output is different for the given examples above (before the Edit section)?

2
+250

For the first example I get the x/y values of A/B:

2.00000048
6.00000048
2.0
5.99999952

and for the second

2.0
5.99999952
2.0
5.99999952
  • +1: Is there a way to globally round any PS calculation to six digits after decimal point? – kiss my armpit Jul 7 '13 at 14:44
  • not with a simple command – user2478 Jul 7 '13 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.