Asked • 05/10/19

Finding if Path2D self-intersects?

I need to find if Path2D intersects itself. For now, I do it by simply extracting an array of lines from path, and finding if any of these intersect. But it has O(n^2) complexity, and so it is very slow. Is there a faster way to do it?

1 Expert Answer

By:

Evan H. answered • 08/28/19

Tutor
5 (42)

Google engineer with 3+ years teaching Java

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.