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.

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

1 Answer 1

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.