# RegionPlot of DiscretizeRegion of ImplicitRegion

Writing:

A = ImplicitRegion[Max[Abs[x - 1 + 2 y], Abs[y - 1 - 2 x]] == 1, {x, y}];
RegionPlot[DiscretizeRegion[A]]


I get: while writing:

A = ImplicitRegion[Max[Abs[x - 1 + 2 y], Abs[y - 1 - 2 x]] == 1., {x, y}];
RegionPlot[DiscretizeRegion[A]]


I get: Why?

Writing:

a = ImplicitRegion[Max[Abs[x-1+2y], Abs[y-1-2x]] == 1., {{x, -1, 1}, {y, -1, 2}}];
RegionPlot[DiscretizeRegion[a, {{-1, 1}, {-1, 2}}]]


I get: and so things are not going well yet!

(I have 11.1.0 for Microsoft Windows (64-bit) (March 13, 2017))

• Specify a region via A = ImplicitRegion[ Max[Abs[x - 1 + 2 y], Abs[y - 1 - 2 x]] == 1., {{x, -1, 1}, {y, -1, 2}}] works for me. Putting the region inside DiscretizeRegion also works: DiscretizeRegion[A, {{-1, 1}, {-1, 2}}] – egwene sedai Sep 22 '17 at 21:48
• Never use an upper-case letter, or even a name that starts with an upper-case letter, as a variable in Mathematica (e.g., A) as it is likely to conflict with system variable names. – David G. Stork Sep 22 '17 at 23:05
• Thanks for the answers. Above, I modified the question by taking it into account. – TeM Sep 23 '17 at 9:40

You can get better results by decreasing the maximum mesh size.

a =
ImplicitRegion[
Max[Abs[x - 1 + 2 y], Abs[y - 1 - 2 x]] == 1., {{x, -1, 1}, {y, -1, 2}}];
RegionPlot[DiscretizeRegion[a, MaxCellMeasure -> .00001]] But, really, in this case you will be much better off using exact numbers; i.e, to replace

Max[Abs[x - 1 + 2 y], Abs[y - 1 - 2 x]] == 1.


with

Max[Abs[x - 1 + 2 y], Abs[y - 1 - 2 x]] == 1


### Update

Here is some code that will get you started on your actual problem as you described it in a comment below.

With[{s = 2},
Manipulate[
Graphics[
{EdgeForm[{Red, Thick}], FaceForm[None],
Translate[Rotate[sqFrame, inclination °], position]},
Frame -> True,
PlotRange -> 5 s,
ImageSize -> 400],
{{position, {0, 0}}, 4.5 s {-1, -1}, 4.5 s {1, 1}, .25, Appearance -> "Labeled"},
{{inclination, 0}, -90, 90, 5, AppearanceElements -> All},
Initialization :> (
sqFrame =
Polygon[
TranslationTransform[-s {1, 1}/2][{{0, 0}, {s, 0}, {s, s}, {0, s}}]])]] • Thank you! Unfortunately I have to simulate the collision between a square frame and a material point, so the square LxL I have to plotted for any center translation and for any angle of rotation, so I was looking for an efficient way to plot it. – TeM Sep 23 '17 at 18:59
• @TeM. That is a very different and much easier question to answer. Simply define a square in terms of its center and its boundary polygon, then use the built-in geometric transforms Rotate and Translate to control the motion of the square in your graphics viewport. The results will be much faster than fooling around with regions. – m_goldberg Sep 23 '17 at 19:49
• Thank you for your patience, unfortunately at times I think of asking for simplifying the problem, when I'm complicating it. I guess I'll open another thread to put the whole question. Thank you! – TeM Sep 23 '17 at 20:24
• Fantastic, really, I understand! – TeM Sep 24 '17 at 9:47