1
$\begingroup$

Suppose I have a RegionPlot, and I want to produce a second graphic, but with a function $f$ applied to every point. For example, I could have the region in the complex plane $\{z \in \mathbb{C} \mid \lvert z \rvert > 1\}$, which I could plot with

RegionPlot[x^2 + y^2 <= 1, {x,-2,2}, {y,-2,2}]

If I now wanted to see what the region looks like under the mapping $$f(z) = 1- \frac{1}{z}$$ I could calculate the appropriate region by hand and plot it. However, is there some way of directly applying a function to a plotted region? That is, given a function $f$, is there some way of writing a MapRegion function that takes a function and a plot, applies the function to every point in the plot, then plots the transformed points?

One idea I had was to create a table of sampling points, map a function over the table using Map, and then plotting those points, but I can't find a function that will plot a region given some points, and this would mean I'd have the new problem of calculating the appropriate boundary points of my region. I'm also aware of the ImplicitRegion function, but this doesn't seem to let you map over it at all.

Is this feasible in Mathematica?

Edit:

After Simon Woods's helpful comment, I found you can do something like the following:

R = ImplicitRegion[x^2 + y^2 <= 1, {x, y}];
g[{x_, y_}] := {-x/(x^2 + y^2), y/(x^2 + y^2)};
P = TransformedRegion[R, g];

But then, when I go to plot this, I get the following:

RegionPlot[P, PlotRange -> {{-2, 2}, {-2, 2}}]

1

Which isn't quite what I expected. If I now do

Q = ImplicitRegion[x^2 + y^2 >= 1, {x, y}]
RegionPlot[Q, PlotRange -> {{-2, 2}, {-2, 2}}]

2

I get what I was expecting.

Why is the filling missing from the first graph?

$\endgroup$
2
  • 2
    $\begingroup$ Did you try anything with TransformedRegion ? $\endgroup$ Jan 31, 2016 at 15:36
  • $\begingroup$ That is EXACTLY what I'm looking for. I'd give you top answer if I could. $\endgroup$
    – MadMonty
    Jan 31, 2016 at 15:52

0

Browse other questions tagged or ask your own question.