Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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)?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

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
share|improve this answer
    
+1: Is there a way to globally round any PS calculation to six digits after decimal point? –  Please don't touch Jul 7 '13 at 14:44
    
not with a simple command –  Herbert Jul 7 '13 at 15:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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