# Is this a bug in RegionEqual?

\$Version


"13.0.1 for Microsoft Windows (64-bit) (January 28, 2022)"


Is this a bug or I am missing something?

Correct result:

ImplicitRegion[x <= 1/3 && y == -x, {x, y}];
HalfLine[{1/3, -1/3}, {-1, 1}];
RegionEqual[%%, %]


True


Returns back the input:

ImplicitRegion[x <= 1/3 && y == -x, {x, y}];
HalfLine[{1/3, -1/3}, {0, 0}];
RegionEqual[%%, %]


RegionEqual[ImplicitRegion[x <= 1/3 && y == -x, {x, y}],
HalfLine[{1/3, -(1/3)}, {0, 0}]]


Incorrect result:

ImplicitRegion[x <= 1/3 && y == -x, {x, y}]
HalfLine[{1/3, -1/3}, {1/4, -1/4}]
RegionEqual[%%, %]


False

• RegionEqual[ImplicitRegion[x <= 1/3 && y == -x, {x, y}], HalfLine[{{1/3, -(1/3)}, {0, 0}}]] and RegionEqual[ImplicitRegion[x <= 1/3 && y == -x, {x, y}], HalfLine[{{1/3, -1/3}, {1/4, -1/4}}]] Jan 31 at 12:46

## 1 Answer

HalfLine[{x1,y1},{v1,v2}] is the half-line start from {x1,y1} with the direction {v1,v2}.

RegionEqual[HalfLine[{{x1, y1}, {x2, y2}}],
HalfLine[{x1, y1}, {x2, y2} - {x1, y1}]]


True

For the comment.

(* Version11.3, 12.2, 12.3.1,13.3.1,14.0 *)
reg1 = ImplicitRegion[{1/3 <= x <= 1/2 && y == -1 + 2 x}, {x, y}];
reg2 = Line[{{1/3, -1/3}, {1/2, 0}}];
{RegionWithin[reg2, reg1], RegionWithin[reg1, reg2]}


True,False.

And all of the above versions also return wrong result when we run

RegionEqual[reg1, reg2]


False.

It is a bug.

• And what about this? Is this a bug? RegionEqual[ ImplicitRegion[{1/3 <= x <= 1/2 && y == -1 + 2 x}, {x, y}], Line[{{1/3, -1/3}, {1/2, 0}}]] It outputs False. Jan 31 at 13:21
• @azerbajdzan I test version 11.3,12.2,12.3.1, 13.3.1,14, It must be a bug. Jan 31 at 13:36
• This is the link to the actual bug: mathematica.stackexchange.com/questions/297270/… Jan 31 at 13:38