4
\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)
    \psplot{2 Pi mul neg RadtoDeg}{2 Pi mul RadtoDeg}{\RPN{x DegtoRad}}
    \qdisk(!\RPN{Pi 3 mul 2 div} Pi 3 mul 2 div RadtoDeg PtoC){3pt}
\end{pspicture}\qquad
\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
5
+100
\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}

enter image description here enter image description here

  • \psDot(3*Pi/2, \Infix{x}) does not compile apparently. – kiss my armpit Nov 23 '13 at 2:50
  • it does (now) ... – user2478 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
  • 1
    less keystrokes ... ;-) – user2478 Nov 27 '13 at 20:50
3

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}

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.