4
$\begingroup$

Is it possible to use TransformedRegion with a Piecewise defined function?

I tried the following, but it doesn't work and I don't understand why.

V[{x_, y_}] = Piecewise[{{{2 x , y}, x < .5 }, {{.5 x , y}, x >=  .5}}];
Region[
 TransformedRegion[Rectangle[], V]
]

EDIT: How does TranformedRegion transform a region? Why does it not work with simple discontinuous or non-differentiable transformations?

$\endgroup$
  • $\begingroup$ What happens if you use Region[TransformedRegion[Rectangle[], {Piecewise[{{2 Indexed[#, 1], Indexed[#, 1] < 1/2}, {Indexed[#, 1]/2, Indexed[#, 1] >= 1/2}}], Indexed[#, 2]} &]]? $\endgroup$ – J. M.'s discontentment May 2 at 11:14
3
$\begingroup$

The map under consideration is discontinuous on Rectangle[] . I have doubts whether TransformedRegion works with such maps. The command

Region[TransformedRegion[Rectangle[], Function[p, {Piecewise[{{2*p[[1]], p[[1]] < 1/2},
{1/2*p[[1]], p[[1]] >= 1/2}}], p[[2]]}]]]

crashes the kernel on my comp and the command

Region[TransformedRegion[Rectangle[], Function[p, {Piecewise[{{2*p[[1]], p[[1]] < 1/2}, 

{3*p[[1]] - 1/2,p[[1]] >= 1/2}}], p[[2]]}]]]

, where the map is continuous, works well.

Addition. The answer to your question can be done in such a way.

r1 = TransformedRegion[Rectangle[{0, 0}, {1/2, 1}],Function[p, {2*p[[1]], p[[2]]}]]
(*Rectangle[{0, 0}, {1, 1}]*)
r2 = TransformedRegion[Rectangle[{1/2, 0},{1, 1}],Function[p, {1/2*p[[1]],p[[2]]}]]
(*Rectangle[{1/4, 0}, {1/2, 1}]*)
RegionUnion[r1, r2]
(*Rectangle[{0, 0}, {1, 1}]*)
| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks. I had already figured out that TransformedRegion does not work well with discontinuous functions. I guess what I wanted to ask was why? How does TransformedRegion work? I like to understand the reason behind this limitation. $\endgroup$ – Cantor May 20 at 6:57
  • $\begingroup$ @Cantor: Your question "How does TransformedRegion work? I like to understand the reason behind this limitation" should be addressed to Mathematica developers. As I was informed by Maple developers, the analogous command of Maple finds the image of the boundary of a transformed region and then fills its interior. If a map is discontinuous, then the image of the boundary as a rule consists of several pieces and the command of Maple does not work. Don't hesitate to ask for further explanation in need. $\endgroup$ – user64494 May 20 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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