Created
April 13, 2020 23:09
-
-
Save PedroRacchetti/0a42a4fed24686856769062650f4c2fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
retangulo interseccao(retangulo r1, retangulo r2){ | |
int x1 = max(r1.x1, r2.x1); | |
int x2 = min(r1.x2, r2.x2); | |
int y1 = max(r1.y1, r2.y1); | |
int y2 = min(r1.y2, r2.y2); | |
retangulo resp; | |
resp.x1 = x1; | |
resp.x2 = x2; | |
resp.y1 = y1; | |
resp.y2 = y2; | |
return resp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment