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.
\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.

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

2 Answers

up vote 5 down vote accepted
+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

share|improve this answer
    
\psDot(3*Pi/2, \Infix{x}) does not compile apparently. –  I am who I say I am 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. –  I am who I say I am Nov 27 '13 at 19:31
1  
less keystrokes ... ;-) –  Herbert Nov 27 '13 at 20:50
    
I see thank you. –  I am who I say I am Nov 27 '13 at 20:55
add comment

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}
share|improve this answer
    
Thank you for voting down. It deserves to get it. –  I am who I say I am Nov 26 '13 at 21:55
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.