<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<title>[pstricks] drawing implicit (polar) plot</title>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:2069647234;
        mso-list-type:hybrid;
        mso-list-template-ids:1093592554 655897994 67567619 67567621 67567617 67567619 67567621 67567617 67567619 67567621;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F0D8;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;
        mso-fareast-font-family:"Times New Roman";
        mso-bidi-font-family:Arial;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>

</head>

<body lang=DE link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Wim Neimeijer wrote:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p style='margin:0cm;margin-bottom:.0001pt'><font size=2 color=navy face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial;color:navy'>&gt; </span></font><font
size=2 face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>I
have a question concerning the implicit polar plot algorithm proposed by <st1:PersonName
w:st="on">Manfred Braun</st1:PersonName></span></font><span lang=EN-GB> <br>
</span><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial;color:navy'>&gt; </span></font><font size=2
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>and
which is used as an example of </span></font><a href="http://www.pstricks.de"><font
size=2 face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>http:/www.pstricks.de</span></font></a><font
size=2 face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>
(polar2.tex)</span></font><span lang=EN-GB> <o:p></o:p></span></p>

<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>&gt; </span></font><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>In the postscript code
where the streamlines and equipotential <font color=navy><span
style='color:navy'>lines</span></font> are plotted</span></font><span
lang=EN-GB> <br>
</span><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial;color:navy'>&gt; </span></font><font size=2
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>via a
call to parametricplot, I am trying to figure out the mapping between the
complex function</span></font><span lang=EN-GB> <br>
</span><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial;color:navy'>&gt; </span></font><font size=2
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>$\Psi$
and the parameter $t$, excerpt of the code attached below.</span></font><span
lang=EN-GB> <o:p></o:p></span></p>

<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>&gt; </span></font><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Question : To be more
specific, in the notes from polar2.tex it says, solve the equation $f(z) = z +
a^2/z$</span></font><span lang=EN-GB> <br>
</span><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial;color:navy'>&gt; </span></font><font size=2
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>using $z
= x + i y$, which would give a quadratic equation ?</span></font><span
lang=EN-GB> <o:p></o:p></span></p>

<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>&gt; </span></font><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>My maths gives me : $f(z)
= \phi(x,y) + i \Psi(x,y) = $ where $Re f(z) = ( r + \frac{a^2}{r} ) \cos \phi
$</span></font><span lang=EN-GB> <br>
</span><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial;color:navy'>&gt; </span></font><font size=2
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>and $Im
f(z) = ( r - \frac{a^2}{r} ) \sin \phi$ </span></font><span lang=EN-GB><o:p></o:p></span></p>

<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>&gt; </span></font><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Question : How does this
lead to a quadratic equation under which assumption ? </span></font><span
lang=EN-GB><br>
<br>
<o:p></o:p></span></p>

<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
lang=EN-GB style='font-size:12.0pt;color:navy'>The equation &nbsp;f = z + a^2/z
&nbsp;is converted into the quadratic equation<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>&nbsp; z^2 &#8211; f z +
a^2 z = 0<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>which can be solved
for&nbsp; z&nbsp; by the standard formula. The unknown&nbsp; z&nbsp; and the coefficient
&nbsp;f, however, are complex numbers. Having solved the equation, just
set&nbsp; z = x + iy&nbsp; and&nbsp; f = phi + i psi. Thus the solution&nbsp; z
= &#8230;&nbsp; provides the points (x, y) corresponding to the pair of
potential and stream function (phi, psi). This is just inverting the original setting&nbsp;
f = f(z), where you obtain the complex potential&nbsp; f&nbsp; corresponding to
a given point&nbsp; z. &nbsp;<o:p></o:p></span></font></p>

<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>&gt; </span></font><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Question : How is the
quadratic equation mapped to the variable $t$ in the parametricplot ?</span></font><span
lang=EN-GB> <o:p></o:p></span></p>

<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>If you fix the potential &nbsp;phi&nbsp; and let the
stream function &nbsp;psi&nbsp; run over a certain interval, you get an
equipotential line. If you fix the stream function &nbsp;psi&nbsp; and allow
the potential&nbsp; phi&nbsp; to vary, you get a streamline.&nbsp; Therefore
the two commands intended to draw equipotential and stream lines differ only in
what is fixed and what is the running curve parameter&nbsp; t.&nbsp; In the case
of streamlines, for instance, the curve parameter&nbsp; t&nbsp; is the
potential phi, while the stream function &nbsp;psi &nbsp;is kept at the fixed
value&nbsp; #1. &nbsp;<o:p></o:p></span></font></p>

<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>&gt; </span></font><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>I want to understand the
lines of code which I indented with HOW </span></font><span lang=EN-GB><br>
</span><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial;color:navy'>&gt; </span></font><font size=2
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>to plot
an other function to make the code a bit more generic.<font color=navy><span
style='color:navy'><o:p></o:p></span></font></span></font></p>

<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>The code starting with &nbsp;{ t #1 &#8230; } puts
the potential&nbsp; phi = t&nbsp; and the stream function&nbsp; psi = #1 &nbsp;on
the stack.&nbsp; These two values are regarded as the real and imaginary parts
of one complex number&nbsp; f. What follows relies on the operations performed
with complex numbers.&nbsp; For instance, if a complex number is on the stack
and you write&nbsp; &#8220; 2 copy cmul &#8220;, the complex number will be
duplicated and then multiplied with itself. As a result the complex
number&nbsp; z^2&nbsp; is on the stack. The operations for complex addition,
multiplication, square root, etc. are provided by the command&nbsp; \complex,
which simply writes the definitions of these operations using&nbsp; \pstVerb{ &#8230;
}. &nbsp;<o:p></o:p></span></font></p>

<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>I have used these complex operations only in some
personal applications. Therefore they are not documented. If there is a general
need for complex arithmetic, the operations could be included in some add-on
package. <o:p></o:p></span></font></p>

<p><font size=3 color=navy face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt;color:navy'>Hopefully these explanations help understanding
the basic idea.<o:p></o:p></span></font></p>

<p><st1:PersonName w:st="on"><font size=2 color=navy face=Arial><span
 lang=EN-GB style='font-size:10.0pt;font-family:Arial;color:navy'>Manfred Braun</span></font></st1:PersonName><font
size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'><o:p></o:p></span></font></p>

</div>

</body>

</html>