- Oct 30, 2000
- 42,589
- 5
- 0
I have two polygons and need to determine if they intersect.
In a nutshell the original algorithm
Check if Poly1 encompasses Poly2 - Yes Returns TRUE
Check if Poly2 encompasses Poly1 - Yes Returns TRUE
Loop over Poly1 sides checking if intersecting anything in Poly2 - Yes Returns TRUE
A rare exception based on alignment of the objects on the display can cause a failure (intersection) when the algorithm tests for enclosure.
What are recommendations for efficient processing algorithms to use. This is in a high use execution code block - embedded avionics system in C.
Thanks
In a nutshell the original algorithm
Check if Poly1 encompasses Poly2 - Yes Returns TRUE
Check if Poly2 encompasses Poly1 - Yes Returns TRUE
Loop over Poly1 sides checking if intersecting anything in Poly2 - Yes Returns TRUE
A rare exception based on alignment of the objects on the display can cause a failure (intersection) when the algorithm tests for enclosure.
What are recommendations for efficient processing algorithms to use. This is in a high use execution code block - embedded avionics system in C.
Thanks