Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm working on a complex question that asks that I determine a function that maps the complement of the region $D=\{z:|z+1|\le 1\}\cup\{z: |z-1|\le 1\}$ onto the upper half plane. That is, $f$ must map the region $C\backslash D$ onto the upper half plane. Here is my proposed answer: $$f(z)=e^{\pi(z+2)(-1+i)/(2z(1+i))}$$

And my code for the function and the region $C\backslash D$:

f = Function[z, Exp[Pi/2*(z + 2)*(-1 + I)/(z*(1 + I))]]
RegionPlot[(x + 1)^2 + y^2 > 1 && (x - 1)^2 + y^2 > 1, {x, -3, 
  3}, {y, -3, 3}]

If someone has a little time, could you maybe provide an easy way of shading the image of region $C\backslash D$ under the function $f$?

share|improve this question
mathematica.stackexchange.com/questions/20634/… together with appropriate RegionFunction –  ssch Aug 18 '13 at 21:32
You've got more than 30 answers to 21 questions, accepted 2, upvoted 2. Did really only 2 answers deserve upvotes? Why should one take his (little) time trying to help and provide nice answers to your questions? –  Artes Aug 18 '13 at 21:46
@Artes - Worse than even me! Though, I have improved. –  Mark McClure Aug 18 '13 at 22:29
@MarkMcClure I don't think that SE reputation is a major advantage of spending one's time here of course, but rather gaining knowledge from others. Having said that, I expect one should acknowledge other's time and effort when getting help. –  Artes Aug 18 '13 at 22:56
@Artes Yes! I improved my voting behavior after being prodded by you. Thanks! (Not that it's outstanding or anything but, certainly, an improvement.) –  Mark McClure Aug 18 '13 at 22:59

2 Answers 2

 Evaluate@(Through[{Re, Im}[
      x + I y]] Boole[((x + 1)^2 + y^2 > 1 && (x - 1)^2 + y^2 > 
        1)]), {x, -3, 3}, {y, -3, 3}, PlotRange -> All]

is your domain

enter image description here

Your mapping:

f = Function[{x, y}, 
  Exp[Pi/2*(x + I y + 2)*(-1 + I)/((x + I y)*(1 + I))]];

maps into upper half plane:

 Evaluate@(Through[{Re, Im}[
      f[x, y]]] Boole[((x + 1)^2 + y^2 > 1 && (x - 1)^2 + y^2 > 
        1)]), {x, -3, 3}, {y, -3, 3}]

enter image description here

share|improve this answer
RegionFunction is a better approach than using Boole. This uses RegionFunction->Function[{x,y,u,v},(u-1)^2+v^2>1&&(u+1)^2+v^2>1]. This seems to work more quickly and efficiently. Boole was a quickk rushed answer. I am currently in very southerly latitude and only rarely online. –  ubpdqn Aug 22 '13 at 23:01

Not to steal ubpdqn's thunder (he has an upvote from me), I prefer to make a dedicated function for this.

SetAttributes[ComplexPlot, HoldAll];

ComplexPlot[f_, {z_Symbol, zmin_?NumericQ, zmax_?NumericQ}, 
Block[{z, u, v, ulims, vlims},
    ulims = {Min[#], Max[#]}& @ {Re[zmin], Re[zmax]};
    vlims = {Min[#], Max[#]}& @ {Im[zmin], Im[zmax]};
    With[{z = u + I v, u = {u, ##}& @@ ulims, v = {v, ##}& @@ vlims},
        ParametricPlot[{Re[f], Im[f]}, u, v, opts]

This simplifies things considerably. For instance, here is a slight modification of an example in the documentation:

ComplexPlot[z + 1/z, {z, -1/2 - 1/2 I, 1/2 + 1/2 I}, PlotRange -> 5, 
   MeshStyle -> {Orange, Green}]

enter image description here

Note: it uses the real and imaginary parts of the limits to generate the limits to plot over. There is no checking, at the moment, to determine if this actually generates a rectangle in the complex plane, or not.

share|improve this answer
Shouldn't vlims be the imaginary part? As it stands ulims==vlims. Can this function be used to map arbitrary domains, e.g. Abs[z]<1, or just rectangular domains? (+1) –  Pickett Aug 21 '13 at 20:02
Thanks for pointing out the typo. Arbitrary domains require a bit more work, so let me think on it. Of course, the real method is to use domainPlot by Simon Woods. –  rcollyer Aug 21 '13 at 20:10

Your Answer


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.