0
My question is for C or cpp or python language developers
If you are given the coordinates of end vertices of two rectangles enclosing some common area between them, then how will you find that common area?
3 ответов
+ 3
This could solved using constructive solid geometry, using the AND operator between 2 rectangles.
https://en.m.wikipedia.org/wiki/Boolean_operations_on_polygons
One way would be to use a BSP tree representing both rectangles and calculate intersection points.
+ 3
Not really as I coded this a long time ago and do not have the program anymore. :D
But I can give you a link to a paper with pseudocode in it:
https://www.google.ca/url?sa=t&source=web&rct=j&url=https://pdfs.semanticscholar.org/eeb5/014f86750c54a87f214b03246799e970d114.pdf&ved=0ahUKEwjHv96K0PzUAhVG6oMKHZvbD1kQFgguMAE&usg=AFQjCNE5S_9JxTXwA4ubuoDToexNGke3XA
0
Can you send the program??