Hai there,

Currently i have finished implementing convex hull however i am having problems with developing merge function (for D&C Hull) where it should merge the left and right hulls. I have seen all the pseudo code but when i try them it seems it is more complicated.

For example;

**L** be left hull and

**R** be the right hull and it may have many point (which i should say that its x and y (2-D))

Psuedo code for finding lower tangent would be:

Finding the Lower Tangent

LowerTangent(HA ; HB ) :

(1) Let a be the rightmost point of HA .

(2) Let b be the leftmost point of HB .

(3) While ab is not a lower tangent for HA and HB do

(a) While ab is not a lower tangent to HA do a = a - 1 (move a clockwise).

(b) While ab is not a lower tangent to HB do b = b + 1 (move b counterclockwise).

(4) Return ab.

The image attached will give you better understanding of what i am looking for...

please reply asap

thanks you

l3-1.gif
start with a guess ab. extend it in both directions. If it intersects a hull move a or b (or both) and try again.

When it does not penetrate that hull you have the desired points.