4
$\begingroup$

The following code is used to map an annulus to a rectangle:

S6 = ImplicitRegion[0.1 <= x^2 + y^2 <= 1, {x, y}];
RegionPlot[S6]
DiscretizeRegion[S6, {{-2, 2}, {-2, 2}}]
r6 = TransformedRegion[S6, {(#1*#1 + #2*#2)^0.5, ArcTan[#2/#1]} &];
RegionQ[r6]
RegionPlot[r6, PlotRange -> {{-0.2, 1.55}, {-2, 2}}, 
 PerformanceGoal -> "Quality"]

    r = TransformedRegion[
   Annulus[{0, 0}, {Sqrt[1/10], 1}], {(#1*#1 + #2*#2)^0.5, 
     ArcTan[#2/#1]} &];
RegionPlot[r, PlotRange -> {{-0.2, 1.55}, {-2, 2}}, 
 PerformanceGoal -> "Quality"]

But the output is not a rectangle. It has obvious jagged edges: region

What can I do to map an annulus to a complete rectangle?

$\endgroup$
5
  • 5
    $\begingroup$ It does not resolve the problem, but you have to use the two-argument-version of ArcTan, so it should be ArcTan[#1, #2] instead of ArcTan[#2/#1]. For a comparison see Plot[{ ArcTan[#2/#1] & @@ {Cos[t], Sin[t]}, ArcTan @@ {Cos[t], Sin[t]} }, {t, -Pi, Pi}] $\endgroup$ Mar 19, 2020 at 7:07
  • 1
    $\begingroup$ @HenrikSchumacher Thank you very much for your comment. In addition, I want to know why ArcTan[#2/#1] causes sawtooth. $\endgroup$ Mar 19, 2020 at 8:32
  • 2
    $\begingroup$ ArcTan[#1, #2] hasn't removed the sawtooth. Just remove the PlotRange option and you'll know what I mean. $\endgroup$
    – xzczd
    Mar 22, 2020 at 6:31
  • 1
    $\begingroup$ easy answer: these spaces are not homotopic ;-P $\endgroup$ Mar 22, 2020 at 16:38
  • 2
    $\begingroup$ @AccidentalFourierTransform It is not a continuous mapping, it just slits the annulus and straightens it out. $\endgroup$ Mar 22, 2020 at 16:44

2 Answers 2

4
+100
$\begingroup$

Fiddling around...not an answer, other than that some obvious attempts don't work.

Try two half annuluses (annuli?)

S7 = ImplicitRegion[(1/10 <= x^2 + y^2 <= 1 && (x >= 0 )), {x, y}];
S8 = ImplicitRegion[(1/10 <= x^2 + y^2 <= 1 && (x <= 0 )), {x, y}];

GraphicsGrid[{{RegionPlot[S8 ], RegionPlot[S7]}}]

enter image description here

Use ToPolarCoordinates[{x, y}] to do the transformation. Now here is a weird one...I have to run ToPolarCoordinates[{x, y}] at least once outside of the transformation call or it fails. Very odd.

ToPolarCoordinates[{x, y}]
r7 = TransformedRegion[S7, Evaluate@ToPolarCoordinates];
r8 = TransformedRegion[S8, Evaluate@ToPolarCoordinates];

The r7 region plots exactly right. The r8 region plots wrong and jagged.

rp7 = RegionPlot[r7, PlotRange -> {{-0.2, 1.55}, 3/2 {-π, π}},
      PerformanceGoal -> "Quality", 
      GridLines -> {Automatic, π (Range[9] - 5)/4}, 
      FrameTicks -> {{π (Range[9] - 5)/4, None}, Automatic}
      ];

rp8 = RegionPlot[r8, PlotRange -> {{-0.2, 1.55}, 3/2 {-π, π}},
      PerformanceGoal -> "Quality", 
      GridLines -> {Automatic, π (Range[9] - 5)/4}, 
      FrameTicks -> {{π (Range[9] - 5)/4, None}, Automatic}
      ];

GraphicsGrid[{{rp7, rp8}}]

enter image description here

I could only get the r7 region to come out right using ToPolarCoordinates. It then gets the range of the angles right too. Didn't work with the hand-rolled transformation as in this question. The r8 region is wrong in the jagged edges and the angle range.

I tried this, but it crashes the kernel when you try to RegionPlot it.

S9 = ImplicitRegion[(1/10 <= x^2 + y^2 <= 1 && (x >= 0 || x <= 0)), {x, y}];

EDIT

Some more experimenting, things appear to work fine until you get x and y values in the lower left quadrant, both negative values. For example, this works fine.

S9 = ImplicitRegion[(1/10 <= x^2 + y^2 <= 1 && ((x >= 0) || (y >= 0))), {x, y}];
RegionPlot[S9]

enter image description here

ToPolarCoordinates[{x, y}]
r9 = TransformedRegion[S9, Evaluate@ToPolarCoordinates];  

rp9 = RegionPlot[r9, PlotRange -> {{-0.2, 1.55}, 3/2 {-π, π}},
                PerformanceGoal -> "Quality", 
                GridLines -> {Automatic, π (Range[9] - 5)/4}, 
                FrameTicks -> {{π (Range[9] - 5)/4, None},Automatic}
                ]

enter image description here

$\endgroup$
2
  • 3
    $\begingroup$ I'm getting crashes at random even in the original formulation, when running in my laptop 11.3. I sent it on to some others with more RegionPlot know-how. The crashes bother me more than the imperfect handling at the discontinuity, though I think that also could be nicer. $\endgroup$ Mar 22, 2020 at 17:07
  • 1
    $\begingroup$ (+11) 千金市骨 :) $\endgroup$
    – xzczd
    Mar 29, 2020 at 12:44
2
$\begingroup$

One possible workaround is to add a thin gap on the annulus:

r = TransformedRegion[
  Annulus[{0, 0}, {Sqrt[1/10], 1}, {-Pi + 0.001, Pi}],
                  {(#1^2 + #2^2)^0.5, ArcTan[#, #2]} &]; 

RegionPlot[r, AspectRatio -> Automatic]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.