# Image of the horizontal lines in the upper half plane under $f(z)=\frac{i-z}{i+z}$? [duplicate]

I would like to visualize the complex function $f(z)=\dfrac{i-z}{i+z}$ by plotting the images of different horizontal lines in the upper half plane under this map.

With the following code

f[z_] := (I - z)/(I + z);
ParametricPlot[{Re[f[x + I*2]], Im[f[x + I*2]]}, {x, -100, 100},
PlotRange -> {{-1.5, 1.5}, {-1.5, 1.5}}]


I am able to plot the image of one horizontal line. How can I do it for multiple ones in one graph?

The following code makes the plot rather ugly:

ParametricPlot[{Re[f[x + I*y]], Im[f[x + I*y]]}, {x, -100, 100}, {y,0,4}
PlotRange -> {{-1.5, 1.5}, {-1.5, 1.5}}]


I'm wondering how I can plot it for "discrete" range: e.g. {y,{0,1,2,3,3.5}}.

I have also read a related question Image of first quadrant under $f(z)=(z+i)/(z-i)$, the answers of which seem not to be very helpful here.

## marked as duplicate by Artes, m_goldberg plotting StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Sep 16 '17 at 23:31

• The related question mentioned in the OP doesn't seem to be very helpful here however another post mentioned in the link certainly does answer your question Plotting complex numbers as an Argand Diagram – Artes Sep 16 '17 at 15:03
• @Artes: That's for discrete points. Do you have a comment for how to generalize it for several lines? – Jack Sep 16 '17 at 15:11
• Read carefully this answer, there I draw images of lines under an analogous mapping, just substitute your mapping and that'll be done. – Artes Sep 16 '17 at 15:21
• @Artes: Thanks for pointing that out. It is much more advanced than I expected. I thought there could be a quick fix of my code to get what I want. Anyway, I'm still slowly reading your answer. I shall come back later when I figure out what's really going on: the animation there is impressed!! – Jack Sep 16 '17 at 15:39

You can use your code to plot multiple versions using Show. Here it is over the range 1 to 8.

f[z_] := (I - z)/(I + z);
Show[ParametricPlot[{Re[f[x + I*#]], Im[f[x + I*#]]}, {x, -100, 100},
PlotRange -> {{-1.5, 1.5}, {-1.5, 1.5}}] & /@ Range[1, 8]]


If you are finding the Map/Slot confusing, you can accomplish the same thing using Table:

Show[Table[ParametricPlot[{Re[f[x + I*i]], Im[f[x + I*i]]}, {x, -100, 100},
PlotRange -> {{-1.5, 1.5}, {-1.5, 1.5}}], {i, 1, 8}]]

• Thanks a lot. This is very helpful! I'm trying to fully understand your code. Would you elaborate what & /@ Range[1, 8] does? (I can see that Range[1,8] gives an array from 1 to 8.) – Jack Sep 16 '17 at 16:23
• Look up Map (for which /@ is the shortcut) and Slot. Basically, the Slot # is filled with each element of the Range (i..e, the slotted variable is mapped over the range). The symbol & is needed to indicate the completion of the Slot. – bill s Sep 16 '17 at 16:26