ChrisVilches / Algorithms

Solutions for competitive programming problems in various online judges such as Kattis, SPOJ, URI Online Judge, etc.
5 stars 0 forks source link

Polygonal Puzzle - Wrong polygon intersection logic (but it works for the problem) #38

Open ChrisVilches opened 1 month ago

ChrisVilches commented 1 month ago

I think the logic I implemented doesn't check for when a polygon is completely inside another polygon, and no edges are touching.

It seems the algorithm only works when edges or vertices are touching.

But it seems this works anyway, because the polygons are always touching in every check. It checks whether they are just touching, or one edge goes "inside" the other polygon, correctly. So it works.

What to do with this issue? Just close it? Or change method name? (that would require me changing the name in the Rust project as well, maybe).