stats786

asked on

# Determine whether a polygon is complex or simple

I have two arrays, storing the x and y values of the polygon.

I want to find out whether the polygon is simple or complex.

The polygon can be concave and is 2d.

Can someone possibly provide suggestions.

Many Thanks.

I want to find out whether the polygon is simple or complex.

The polygon can be concave and is 2d.

Can someone possibly provide suggestions.

Many Thanks.

ASKER

I've tried doing an edge-edge test, but it fails for some reason. Could it be that an edge sharing the same node brings back true when doing the edge on edge test?

Yes, this sounds plausible. But you can simply omit to test the neighbor edges as they will never intersect each other.

ASKER CERTIFIED SOLUTION

membership

Create a free account to see this answer

Signing up is free and takes 30 seconds.

**No credit card required.**
The intersection of 2 lines can be tested with an algorithm like this:

http://www.macs.hw.ac.uk/~alison/ds98/node114.html