0

Let CH1 and CH2 be two convex polygons. Give an algorithm computing, in time linear with the number of vertices, the convex hull of their union justifying that it works in all the different possible cases of mutual relations between the two polygons.

is there any way to do this?

Deepinfo
  • 31
  • 2

1 Answers1

1

Rotating calipers is powerful instrument for such problems.

Look at part 2.6 The Convex Hull of Two Convex Polygons of this article

To comment: I am sure this is very simple algorithm.

  • Start with vertical line.
  • Find the leftmost points of both polygons. Choose the most left one of them. It belongs to hull.
  • Fix the line in this point.
  • Rotate the line about this point until it touches next point (from both polygons) (note that you need only forward search, so overall time is O(m+n))
  • Add this point to the hull, fix line.
  • Repeat.

Look article (and other rot.cal. descriptions) for details.

Note that this algorithm resembles gift wrapping

MBo
  • 77,366
  • 5
  • 53
  • 86
  • thank you for your responding,,I am asking for algorithm so in this article there is not something about algorithme – Deepinfo Apr 14 '16 at 13:29
  • 1
    The article is about algorithms. Precisely. It seems you want another meaning of 'algorithm'... – MBo Apr 14 '16 at 14:28
  • I'm looking for a very simple algorithm for computing the polygon – Deepinfo Apr 14 '16 at 21:17
  • Probably you did not read cited article. Try to understand described approach. I've added some words. – MBo Apr 15 '16 at 02:52