Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intersection is not counted properly #212

Open
Sulyma30 opened this issue Jun 12, 2023 · 1 comment
Open

Intersection is not counted properly #212

Sulyma30 opened this issue Jun 12, 2023 · 1 comment

Comments

@Sulyma30
Copy link

Sulyma30 commented Jun 12, 2023

If a bbox degenerates into an interval (x_min=x_max or y_min=y_max), then corresponding width=0 and intersection is not counted

@Sulyma30
Copy link
Author

Sulyma30 commented Jun 12, 2023

We can instead check whether any outermost point of one interval is inside of another interval:

def check_intervals_intersection(a,b,c,d):
if (a <= d and a >= c) or (b <= d and b >= c) or (c <= b and c >= a) or (d <= b and d >= a):
return True
else:
return False

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant