Page 1 of 1
algorithm to determine that polygon is star-shaped
Posted: Fri Aug 18, 2006 2:47 pm
by kwedeer
Can anyone suggest some comp. geom. algorithm to prove or reject that some polygon is star-shaped (there exist some point which is visible from every point on border)?
Posted: Fri Aug 18, 2006 2:57 pm
by Cosmin.ro
halfplane intersection doable with duality in O(n log n) or by a naive algorithm in O(n^2).
Posted: Fri Aug 18, 2006 4:59 pm
by kwedeer
thanks! Is some link available for them? They are not mentioned in Cormen, wiki.
Posted: Fri Aug 18, 2006 7:41 pm
by Cosmin.ro
try google ...
Posted: Sun Sep 03, 2006 7:59 pm
by kwedeer
now I have idea - simply collect all the vertices of polygon in on set and then try to construct the converx polygon from these vertices (using Graham scan or Jarvis march - both from Cormen algorithm book) and at the end check - if any vertex has been left outside the border of constructed convex plygon. If such vertex exists then initial polygon has been concave, if doesn;t exist - then inital polygon was convex.
So - can there be cases when this proposal doesn't work?
Posted: Sun Sep 03, 2006 9:05 pm
by Erik
Hi,
So - can there be cases when this proposal doesn't work?
This depends on what you want to do.
Of course you can check this way if the polygon is either convex or concave. But you were asking to determine if it is star-shaped. And a star may sure be concave.
As Cosmin.ro said, it's all about half-plane intersection.
Cu, Erik

Posted: Sun Sep 03, 2006 9:08 pm
by ayon
if any vertex has been left outside the border of constructed convex plygon.
there shouldn't be any vertices left outside of the convex hull
Posted: Sun Sep 03, 2006 10:30 pm
by kwedeer
I meant the following by 'outside of border': vertex of initial polygon that is no included on to the border of the constructed polygon. Namely, this vertex will be inside the border.