ELI5: Explain Like I'm 5

Inside–outside algorithm

Okay, imagine you are playing a game where you have a big shape and a small shape inside of it. The big shape is the outside and the small shape is the inside. Now, you want to find out if the small shape is completely inside the big shape.

To do this, you need to use the inside-outside algorithm. This is like a rulebook that tells you how to check if the small shape is inside of the big shape.

First, you need to pick a point outside of the big shape. This will be your starting point. Then, you draw an imaginary line from that point to any point on the small shape.

Now, you look to see where the line intersects with the big shape. If it goes through the big shape only once, then you know the small shape is inside the big shape. If the line goes through the big shape more than once or doesn’t go through at all, then the small shape is not completely inside the big shape.

You keep repeating this process with different starting points until you have checked all possible starting points. If every line you draw intersects with the big shape only once, then you know for sure that the small shape is completely inside the big shape.

So, that’s the inside-outside algorithm! It’s like a game where you draw lines to check if one shape is inside another shape.