TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Constraints

Assume I don't want to use infix-RPN package for unknown logical reason (seriously). Instead I want to use my own A2P describe as follows. In the first case it succeeds but it fails for the second case.

Case 1 (succeed)

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot}

\pstVerb{/A2P {exec AlgParser cvx /t ED  exec AlgParser cvx exec t RadtoDeg PtoC} def }

\def\RR#1{(2^(#1/10))}
\def\TT#1{(#1)}

\begin{document}
\begin{pspicture}[showgrid](-3,-3)(3,3)
  \psplot[algebraic,polarplot]{2 Pi mul neg}{4 Pi mul}{\RR{x}}
  \pscircle*[linecolor=red  ](!\RR{7*Pi/2} \TT{7*Pi/2} A2P){2pt}
  \pscircle*[linecolor=green](!{(2^(t/10))} {(3*Pi/2)} A2P){2pt}
  \pscircle*[linecolor=blue ](!\RR{t} \TT{5*Pi/2} A2P){2pt}
\end{pspicture}

\end{document}

Case 2 (failed)

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-func}

\pstVerb{/A2P {exec AlgParser cvx /t ED  exec AlgParser cvx exec t RadtoDeg PtoC} def }
\def\f(#1){(sin(#1)+1.2)}%

\begin{document}
\begin{pspicture}(-0.5,-3)(7,3)
    \psVolume[fillstyle=solid,fillcolor=orange!50,linecolor=blue](0,\psPiTwo){10}{{\f(x)} A2P}
\end{pspicture}
\end{document}

Question

How can I reuse

\pstVerb{/A2P {exec AlgParser cvx /t ED  exec AlgParser cvx exec t RadtoDeg PtoC} def }

for \psVolume?

share|improve this question
up vote 3 down vote accepted
+150

In your first case you apply A2P to the x and y values. The function parameter for \psVolume, however, evaluates to a single value only:

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-func}

\pstVerb{/A2P {exec AlgParser cvx exec} def }
\def\f(#1){(sin(#1)+1.2)}%

\begin{document}
\begin{pspicture}(-0.5,-3)(7,3)
    \psVolume[fillstyle=solid,fillcolor=orange!50,linecolor=blue](0,\psPiTwo){10}{{\f(x)} A2P}
\end{pspicture}
\end{document}

enter image description here

share|improve this answer

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.