Algorithm for intersection between polyline and rectangle?

707 Views Asked by At

My problem is simple, and probably obvious from the title itself, but I'll still clarify it a bit:

I have a rectangle and a polyline (array of N connected points). I need an optimal algorithm that checks if intersection between them exists (true/false).

Could someone please point me to one?

Thanks in advance