algorithm to determine that polygon is star-shaped
Moderator: Board moderators
algorithm to determine that polygon is star-shaped
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)?
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?
So - can there be cases when this proposal doesn't work?
Hi,
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
This depends on what you want to do.So - can there be cases when this proposal doesn't work?
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
