Skip to content

Instantly share code, notes, and snippets.

@PedroRacchetti
Created April 13, 2020 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PedroRacchetti/0a42a4fed24686856769062650f4c2fc to your computer and use it in GitHub Desktop.
Save PedroRacchetti/0a42a4fed24686856769062650f4c2fc to your computer and use it in GitHub Desktop.
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