lozina
Lifer
Anyone good with the geometry algorithms?
I need an algorithm which detects if *any* point of a line is within a given rectangle
and:
an algorithm which detects if *any* point of a rectangle is within another given rectangle (though maybe the algorithm above can be used on the 4 sides for this one)
the thing is though, it HAS to be fast. I cant have any brute force method I need the most efficient streamlined way to do it...
So far my searching has found plenty of algorithms for detecting if one rectangle is ENTIRELY within another - but thats no good. Also I found intersection algorithms for rectangles but they do extra work by calculating the intersected areas - performance hit for me.
I need an algorithm which detects if *any* point of a line is within a given rectangle
and:
an algorithm which detects if *any* point of a rectangle is within another given rectangle (though maybe the algorithm above can be used on the 4 sides for this one)
the thing is though, it HAS to be fast. I cant have any brute force method I need the most efficient streamlined way to do it...
So far my searching has found plenty of algorithms for detecting if one rectangle is ENTIRELY within another - but thats no good. Also I found intersection algorithms for rectangles but they do extra work by calculating the intersected areas - performance hit for me.