Convex Hulls

37
Convex Hulls Computational Geometry, WS 2007/08 Lecture 2 – Supplementary Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für Angewandte Wissenschaften Albert-Ludwigs-Universität Freiburg

description

Convex Hulls. Computational Geometry, WS 2007/08 Lecture 2 – Supplementary Prof. Dr. Thomas Ottmann. Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für Angewandte Wissenschaften Albert-Ludwigs-Universität Freiburg. Area of Triangle. Underlying idea: - PowerPoint PPT Presentation

Transcript of Convex Hulls

Page 1: Convex Hulls

Convex Hulls

Computational Geometry, WS 2007/08Lecture 2 – Supplementary

Prof. Dr. Thomas Ottmann

Algorithmen & Datenstrukturen, Institut für InformatikFakultät für Angewandte WissenschaftenAlbert-Ludwigs-Universität Freiburg

Page 2: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 2

Area of Triangle

• Underlying idea:– For every edge, compute between it and a given line (or

point).– Sum the area in a predetermined order.

• Generalizable for any polygon.

Page 3: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 3

Area of Triangle

• Use x-axis line as reference.

• Compute in clockwise order.

(x0,y0)

(x1,y1)

(x2,y2)

Page 4: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 4

Area of Triangle

½ (x1 – x0 )(y0 + y1 )

(x0,y0)

(x1,y1)

(x2,y2)

Page 5: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 5

Area of Triangle

½ (x1 – x0 )(y0 + y1 )

+

½ (x2 – x1 )(y1 + y2 )

(x0,y0)

(x1,y1)

(x2,y2)

Page 6: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 6

Area of Triangle

½ (x1 – x0 )(y0 + y1 )

+

½ (x2 – x1 )(y1 + y2 )

+

½ (x0 – x2 )(y2 + y0 )(x0,y0)

(x1,y1)

(x2,y2)

Page 7: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 7

Area of Triangle

½ (x1 – x0 )(y0 + y1 )

+

½ (x2 – x1 )(y1 + y2 )

+

½ (x0 – x2 )(y2 + y0 )

(x0,y0)

(x1,y1)

(x2,y2)

= ½ [(x1 – x0 )(y0 + y1 ) + (x2 – x1 )(y1 + y2 ) + (x0 – x2 )(y2 + y0 )]

= ½ [ x1y0 + x1y1 – x0y0 – x0y1 + x2y1 + x2y2 – x1y1 – x1y2

+ x0y2 + x0y0 – x2y2 – x2y0 ]

= ½ [ x1y0 + x2y1 + x0y2 – x0y1 – x1y2 – x2y0 ]

Page 8: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 8

Area of Triangle

(x0,y0)

(x1,y1)

(x2,y2)

| x0 y0 1 |

| x1 y1 1 |

| x2 y2 1 |Area of triangle = ½

Page 9: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 9

Convex Hull – Divide & Conquer

• Split set into two, compute convex hull of both, combine.

Page 10: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 10

Convex Hull – Divide & Conquer

• Split set into two, compute convex hull of both, combine.

Page 11: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 11

Convex Hull – Divide & Conquer

• Split set into two, compute convex hull of both, combine.

Page 12: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 12

Convex Hull – Divide & Conquer

• Split set into two, compute convex hull of both, combine.

Page 13: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 13

Convex Hull – Divide & Conquer

• Split set into two, compute convex hull of both, combine.

Page 14: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 14

Convex Hull – Divide & Conquer

• Split set into two, compute convex hull of both, combine.

Page 15: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 15

Convex Hull – Divide & Conquer

• Split set into two, compute convex hull of both, combine.

Page 16: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 16

Convex Hull – Divide & Conquer

• Split set into two, compute convex hull of both, combine.

Page 17: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 17

Convex Hull – Divide & Conquer

• Split set into two, compute convex hull of both, combine.

Page 18: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 18

Convex Hull – Divide & Conquer

• Split set into two, compute convex hull of both, combine.

Page 19: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 19

Convex Hull – Divide & Conquer

• Split set into two, compute convex hull of both, combine.

Page 20: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 20

Convex Hull – Divide & Conquer

• Merging two convex hulls.

Page 21: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 21

Convex Hull – Divide & Conquer

• Merging two convex hulls: (i) Find the lower tangent.

Page 22: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 22

Convex Hull – Divide & Conquer

• Merging two convex hulls: (i) Find the lower tangent.

Page 23: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 23

Convex Hull – Divide & Conquer

• Merging two convex hulls: (i) Find the lower tangent.

Page 24: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 24

Convex Hull – Divide & Conquer

• Merging two convex hulls: (i) Find the lower tangent.

Page 25: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 25

Convex Hull – Divide & Conquer

• Merging two convex hulls: (i) Find the lower tangent.

Page 26: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 26

Convex Hull – Divide & Conquer

• Merging two convex hulls: (i) Find the lower tangent.

Page 27: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 27

Convex Hull – Divide & Conquer

• Merging two convex hulls: (i) Find the lower tangent.

Page 28: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 28

Convex Hull – Divide & Conquer

• Merging two convex hulls: (i) Find the lower tangent.

Page 29: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 29

Convex Hull – Divide & Conquer

• Merging two convex hulls: (i) Find the lower tangent.

Page 30: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 30

Convex Hull – Divide & Conquer

• Merging two convex hulls: (ii) Find the upper tangent.

Page 31: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 31

Convex Hull – Divide & Conquer

• Merging two convex hulls: (ii) Find the upper tangent.

Page 32: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 32

Convex Hull – Divide & Conquer

• Merging two convex hulls: (ii) Find the upper tangent.

Page 33: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 33

Convex Hull – Divide & Conquer

• Merging two convex hulls: (ii) Find the upper tangent.

Page 34: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 34

Convex Hull – Divide & Conquer

• Merging two convex hulls: (ii) Find the upper tangent.

Page 35: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 35

Convex Hull – Divide & Conquer

• Merging two convex hulls: (ii) Find the upper tangent.

Page 36: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 36

Convex Hull – Divide & Conquer

• Merging two convex hulls: (ii) Find the upper tangent.

Page 37: Convex Hulls

Computational Geometry, WS 2007/08Prof. Dr. Thomas Ottmann 37

Convex Hull – Divide & Conquer

• Merging two convex hulls: (iii) Eliminate non-hull edges.