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

Add BoundingBox union and intersection #277

Merged
merged 4 commits into from
Jun 12, 2019
Merged

Conversation

larrybradley
Copy link
Member

Examples:

>>> from regions import BoundingBox

>>> bbox1 = BoundingBox(1, 10, 2, 20)
>>> bbox2 = BoundingBox(5, 21, 7, 32)

>>> bbox1.union(bbox2)
BoundingBox(ixmin=1, ixmax=21, iymin=2, iymax=32)

>>> bbox1 | bbox2
BoundingBox(ixmin=1, ixmax=21, iymin=2, iymax=32)

>>> bbox1.intersection(bbox2)
BoundingBox(ixmin=5, ixmax=10, iymin=7, iymax=20)

>>> bbox1 & bbox2
BoundingBox(ixmin=5, ixmax=10, iymin=7, iymax=20)

@larrybradley larrybradley added this to the 0.4 milestone Jun 12, 2019
Copy link
Member

@cdeil cdeil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@cdeil cdeil merged commit 54aac61 into astropy:master Jun 12, 2019
@larrybradley larrybradley deleted the bbox branch June 12, 2019 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants