# How to draw a point if the angle value and radial function are both given in algebraic (infix) form?

\documentclass[preview,border=12pt]{standalone}
\usepackage{pst-plot}
\psset{polarplot}
\def\RPN#1{2 #1 10 div exp}
\def\Infix#1{2^(#1/10)}

\begin{document}
\begin{pspicture}[showgrid=true](-3,-3)(3,3)
\qdisk(!\RPN{Pi 3 mul 2 div} Pi 3 mul 2 div RadtoDeg PtoC){3pt}
\begin{pspicture}[showgrid=true](-3,-3)(10,3)
\psplot[algebraic]{2 Pi mul neg}{2 Pi mul}{\Infix{x}}
%\qdisk(<your expression using \Infix goes here>){3pt}
\end{pspicture}
\end{document}


How to draw a point if the angle value and radial function are both given in algebraic (infix) form?

Notes: Both angle and radius must accommodate infix expression such as 3*Pi/2 for the angle and 2^(3*Pi/2/10) for the radius.

-
Maybe \fnpnode (from pst-node) can be adapted to accept the polarplot option. – Christoph Sep 18 '13 at 8:33

\documentclass[border=12pt]{standalone}
\usepackage{pst-plot}
\def\ItoP{ AlgParser cvx }
\def\AtoP{ \ItoP exec x RadtoDeg PtoC}
\def\psDot(#1,#2){\psdot[dotscale=2](! #1 \ItoP /x ED #2 \AtoP)}

\def\Y#1{(2^(#1/10))}
\def\X#1{(#1)}

\begin{document}
\begin{pspicture}[showgrid](-3,-3)(3,3)
\psplot[algebraic,polarplot]{2 Pi mul neg}{2 Pi mul}{\Y{x}}
%  \psDot(\X{Pi}, \Y{x})
\psDot(\X{3*Pi/10}, \Y{x})
\end{pspicture}

\end{document}


-
\psDot(3*Pi/2, \Infix{x}) does not compile apparently. – kiss my armpit Nov 23 '13 at 2:50
it does (now) ... – Herbert Nov 27 '13 at 9:16
Is there any advantage to use \def instead of \pstVerb in this case? In my opinion, using \pstVerb can make the expression more natural in PostScript world as we don't need to type  which is more suitable for TeX world. – kiss my armpit Nov 27 '13 at 19:31
less keystrokes ... ;-) – Herbert Nov 27 '13 at 20:50
I see thank you. – kiss my armpit Nov 27 '13 at 20:55

Just another simpler way but it is totally bad as we have to determine the quadrant manually (the sign of ordinate must be determined manually whether or not it is below or above the x-axis).

\qdisk(+{\Infix{(3*Pi/2)}*cos(3*Pi/2)},{-sqrt((\Infix{(3*Pi/2)})^2-x^2)}){3pt}


The MWE:

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

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

\begin{document}
\begin{pspicture}[showgrid=true](-3,-3)(3,3)
\psplot[algebraic]{2 Pi mul neg}{2 Pi mul}{\Infix{x}}
\qdisk(+{\Infix{(3*Pi/2)}*cos(3*Pi/2)},{-sqrt((\Infix{(3*Pi/2)})^2-x^2)}){3pt}
\end{pspicture}
\end{document}

-
Thank you for voting down. It deserves to get it. – kiss my armpit Nov 26 '13 at 21:55