Source code online books for professionals by professionals


Figure 6-8.  A set of points and their convex hull Figure 6-9



Download 4,67 Mb.
Pdf ko'rish
bet106/266
Sana31.12.2021
Hajmi4,67 Mb.
#213682
1   ...   102   103   104   105   106   107   108   109   ...   266
Bog'liq
2 5296731884800181221

Figure 6-8.  A set of points and their convex hull
Figure 6-9.  Combining two smaller convex hull by finding upper and lower common tangents (dashed)
By now, I’m sure you’re suspecting how we’ll be solving this: Divide the point set into two equal halves along 
the x-axis and solve them recursively. The only part remaining is the linear-time combination of the two solutions. 
Figure 
6-9
 hints at what we need: We must find the upper and lower common tangents. (That they’re tangents basically 
means that the angles they form with the preceding and following line segments should curve inward.)
14
A region is convex if you can draw a line between any two points inside it, and the line stays inside the region.


Chapter 6 

 DiviDe, Combine, anD Conquer
130
Without going into implementation details, assume that you can check whether a line is an upper tangent for 
either half. (The lower part works in a similar manner.) You can then start with the rightmost point of the left half and 
the leftmost point of the right half. As long as the line between your points is not an upper tangent for the left part, you 
move to the next point along the subhull, counterclockwise. Then you do the same for the right half. You may have to 
do this more than once. Once the top is fixed, you repeat the procedure for the lower tangent. Finally, you remove the 
line segments that now fall between the tangents, and you’re done.

Download 4,67 Mb.

Do'stlaringiz bilan baham:
1   ...   102   103   104   105   106   107   108   109   ...   266




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish