1 helmut schauer educational engineering lab department for information technology university of...
TRANSCRIPT
![Page 1: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/1.jpg)
1
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Geometrische Algorithmen
![Page 2: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/2.jpg)
2
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Beispiel:Konvexe Hülle einer 2D-Punktmenge (1)
Die Konvexe Hülle ist ein konvexes Polygon mit minimalem Umfang das sämtliche gegebenen Punkte einschliesst.
Punktmenge Konvexe Hülle
![Page 3: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/3.jpg)
3
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Konvexe Hülle einer 2D-Punktmenge (2)Graham-Scan O(N log N)
1) Bilde ein Polygon das die gegebenen Punkte ohne Überschneidungen verbindet2) Eliminiere sämtliche "einspringenden" Eckpunkte
Punktmenge Polygon Konvexe Hülle
![Page 4: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/4.jpg)
4
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Konvexe Hülle einer 2D-Punktmenge (3)Polygon
Algorithmus zur Bildung eines Polygons:
1) Wähle einen Startpunkt (zB den untersten Punkt) und berechne zu jedem weiteren Punkt den Winkel den die Verbindung dieses Punktes und dem Startpunkt mit der Horizontalen einschliesst.
2) Verbinde die Punkte in steigender Reihenfolge dieser Winkel
Punktmenge Polygon
![Page 5: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/5.jpg)
5
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Konvexe Hülle einer 2D-Punktmenge (4)Eliminierung einspringender Eckpunkte
![Page 6: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/6.jpg)
6
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Theta-Funktion
double theta(Point p) {double t;int dx = this.x-p.x;int dy = p.y-this.y;if ((dx==0)&(dy==0)) t = 0;else t = (double)dy/(double)(Math.abs(dx)+Math.abs(dy));if (dx<0) t = 2-t;else if (dy<0) t = 4+t;return t;
}
![Page 7: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/7.jpg)
7
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Orientierung eines Dreiecks
public boolean convex(Point p1, Point p2, Point p3) {int dx1 = p2.x-p1.x;int dx2 = p3.x-p2.x;int dy1 = p1.y-p2.y;int dy2 = p2.y-p3.y;return dy2*dx1>dy1*dx2;
}
![Page 8: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/8.jpg)
8
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Attribute Geometrischer Algorithmen
DimensionOrientierungOrthogonalitätQueryobjekt
![Page 9: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/9.jpg)
9
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Klassifizierung Geometrischer Algorithmen
Bereichssuche Schnittprobleme EinschlussproblemeDistanzprobleme
![Page 10: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/10.jpg)
10
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Bereichssuche (Range Searching)eindimensional O(R+log N)
Geg: eine Menge X von x-Koordinaten, N = |X|ein Query-Intervall [xl,xr]
Ges: {x X: x [xl,xr]}
![Page 11: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/11.jpg)
11
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
1D-Suchbaum
![Page 12: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/12.jpg)
12
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Range Searching Implementierungeindimensional
void range(Interval x, Visitor v) {boolean tl = x.l <= key;boolean tr = key <= x.r;if (tl) left.range(x,v);if (tl&tr) v.action(key);if (tr) right.range(x,v);
}
![Page 13: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/13.jpg)
13
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Bereichssuche (Range Searching)zweidimensional O(R+log N)
![Page 14: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/14.jpg)
14
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
2D-Suchbaum
![Page 15: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/15.jpg)
15
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Range Searching Implementierungzweidimensional (2D-Tree)
void range(Rectangle r, Visitor v, int level) {boolean tl, tr;if (level%2 == 0) {tl = r.x <= key.x;tr = key.x <= r.x+r.width;} else {tl = r.y <= key.y;tr = key.y <= r.y+.height;}if (tl) left.range(r,v,level+1);if (r.contains(key)) v.action(key);if (tr) right.range(r,v,level+1);
}
![Page 16: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/16.jpg)
16
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Segmentschnitt (Segment Intersection)orthogonal O(I+N log N)
![Page 17: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/17.jpg)
17
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Rechteckschnitt mittels Sweep-Line (1)
![Page 18: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/18.jpg)
18
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Rechteckschnitt mittels Sweep-Line (2)
![Page 19: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/19.jpg)
19
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Rechteckschnitt mittels Sweep-Line (3)
![Page 20: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/20.jpg)
20
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Rechteckschnitt mittels Sweep-Line (4)
![Page 21: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/21.jpg)
21
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Rechteckschnitt mittels Sweep-Line (5)
![Page 22: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/22.jpg)
22
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Segmentschnitt (Segment Intersection)nicht-orthogonal O((I+N) log N)
![Page 23: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/23.jpg)
23
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Punkteinschluss (Point Inclusion)O(log N)
Geg: mehrere Segmente und ein PunktGes: alle Segmente die den Punkt einschliessen
![Page 24: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/24.jpg)
24
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Segmentbaum (Segment Tree)
dcba,ba
d
c
b
a
b,c c,d
cba
![Page 25: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/25.jpg)
25
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Closest PairO(N log N)
![Page 26: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/26.jpg)
26
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Nearest NeighbourO(log N)
![Page 27: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/27.jpg)
27
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Voronoi DiagrammO(N log N)
![Page 28: 1 Helmut Schauer Educational Engineering Lab Department for Information Technology University of Zurich Geometrische Algorithmen](https://reader036.vdocument.in/reader036/viewer/2022062521/570491c41a28ab14218da38a/html5/thumbnails/28.jpg)
28
Helmut SchauerEducational Engineering LabDepartment for Information TechnologyUniversity of Zurich
Delaunay TriangulierungO(N log N)