the '+' does an addition, admittedly that should have been an | instead to be more clear. I have edited the article
coords[:, 0] == coords[:, 2] generates a list that is True if the x values are the same and False otherwise
coords[:, 1] == coords[:, 3] generates a list that is True if the y values are the same and False otherwise
so (coords[:, 0] == coords[:, 2]) + (coords[:, 1] == coords[:, 3]) adds those together, so the result is True if either of the two conditions are true. I should have used | to do an OR operation instead. Though the result is the same.
the '+' does an addition, admittedly that should have been an
|
instead to be more clear. I have edited the articlecoords[:, 0] == coords[:, 2] generates a list that is True if the x values are the same and False otherwise
coords[:, 1] == coords[:, 3] generates a list that is True if the y values are the same and False otherwise
so (coords[:, 0] == coords[:, 2]) + (coords[:, 1] == coords[:, 3]) adds those together, so the result is True if either of the two conditions are true. I should have used
|
to do an OR operation instead. Though the result is the same.Longer code could look like: