ECE Su09; Dr. Farag

Size: px
Start display at page:

Download "ECE Su09; Dr. Farag"

Transcription

1 ECE 600: Introduction to Shape Analysis Lab #5 Convex Hull in 3D (Assigned Thursday 6/18/09 Due Thursday 6/25/09) In this lab, we will discuss the details of computing convex hull in 3D using Incremental algorithm, refer to lecture notes for more theoretical details. As usual we will start with data structures. Table of Contents Table of Code Snippets Data Representation Structures Definitions Example of Data Structures Polyhedron Class Data Structures more details Example: Cube Main function Vertex List Create the initial polytope Construct the hull Now time for tasks Task 1: Task 2: Task 3:

2 Table of Code Snippets Code 1 - Basic fields of Vertex3D, Edge3D and Face3D classes... 3 Code 2 - Basic fields of Polyhedron class... 6 Code 3 - All fields of Vertex3D, Edge3D and Face3D classes... 6 Code 4 - main function... 9 Code 5 constructvertexlist function Code 6 DoubleTriangle function Code 7 Collinear function Code 8 MakeFace function Code 9 VolumeSign function Code 10 ConstructHull function Code 11 AddOne function Code 12 MakeConeFace function Code 13 MakeCcw function Code 14 CleanUp function Code 15 CleanEdges, CleanFaces and CleanVertices functions

3 1. Data Representation 1.1 Structures Definitions We want to represent the surface of a polyhedron. There are three primary data types: vertices, edges, and faces. All the vertices are doubly linked into a circular list, as are all the edges, and all the faces. These lists have the same structure as the list of polygon vertices used in Lab 3. The ordering of the elements in the list has no significance; so these lists should be thought more as sets than as lists. Each element of these lists is a fixed-size structure containing relevant information, including links into the other lists. The vertex structure contains the coordinates of the vertex. It contains no pointers to its incident edges nor its incident faces. (Note that inclusion of such pointers would not be straightforward, because a vertex may be incident to an arbitrary number of edges and faces.) The edge structure contains pointers to the two vertices that are points of the edge and pointers to the two adjacent faces. The ordering of both of these pairs is arbitrary; more sophisticated data structures enforce an ordering. The face structure contains pointers to the three vertices forming the corners of the triangular face, as well as pointers to the three edges. Note that it is here that we exploit our assumption that all faces are triangles. The basic fields of the three structures are shown in Code 1. The structures will need to contain other miscellaneous fields, which will be discussed shortly. Code 1 - Basic fields of Vertex3D, Edge3D and Face3D classes classdef Vertex3D < handle vertexid point % this will contain the xyz coordinates of the vertex, % it will be of type Point3D next % next vertex prev % prev vertex classdef Edge3D < handle edgeid adjacentfaces ingpoints next prev % the two faces which share this edge % this is point to Face3D class. % it will be array of size two % the two ing vertexs (Vertex3D) % next edge % prev edge classdef Face3D < handle faceid edges % cell array of three edges (Edge3D) constructing the face 3

4 vertices % cell array of three vertices (Vertex3D) constructing the % face next % next face prev % prev face 1.2 Example of Data Structures We will illustrate the convex hull code with a running example, constructing the hull of eight points comprising the corners of a cube. One of the polytopes created during constructing the final cube has five vertices, and we use this to illustrate the data structures. Call the polytope P 5. The vertex list contains all the input points; not all are referenced by the edge and face lists. The cube has edge length 10 and is in the positive orthant (quadrant in 3D) of the coordinate system. The indices assigned here to the vertices (and edges and faces) play no role in the code, as all references are conducted via pointers. The polytope P 5 consists of 9 edges and 6 faces. The three lists in Tables 1-3 are shown exactly as they are constructed by the code. The indices on the v, e, and f labels indicate the order in which the records were created. Note that the face list contains no f 1 or f 4 ; both were created and deleted before the illustrated snapshot of the data structures. A view of the polytope is shown in Figure 1. Faces f 2, f 5 and f 6 are visible; f 0 is on the xy-plane. The two "back" faces, f 3 and f 7, are coplanar, forming a square face of the cube, (v 0, v 1, v 5, v 4 ). An important property of the face data structure that is maintained at all times is that the vertices in field vertex are ordered counterclockwise, so that the right-hand rule yields a vector normal to the face pointing exterior to the polytope. Thus f 6 s vertices occur in the order (v 4, v 2, v 5 ). The same counterclockwise ordering is maintained for the edge field. Thus the ordering of f 6 s edges is (e 4, e 6, e 8 ). Table 1 - Vertex List Vertex Coordinates v 0 (0,0,0) v 1 (0,10,0) v 2 (10,10,0) v 3 (10,0,0) v 4 (0,0,10) v 5 (0,10,10) v 6 (10,10,10) v 7 (10,0,10) 4

5 Table 2 - Edge List Edge End points Adjacent faces e 0 (v 0, v 2 ) (f 2, f 0 ) e 1 (v 1, v 0 ) (f 3, f 0 ) e 2 (v 2, v 1 ) (f 5, f 0 ) e 3 (v 0, v 4 ) (f 2, f 3 ) e 4 (v 2, v 4 ) (f 2, f 6 ) e 5 (v 1, v 4 ) (f 3, f 7 ) e 6 (v 2, v 5 ) (f 5, f 6 ) e 7 (v 1, v 5 ) (f 5, f 7 ) e 8 (v 4, v 5 ) (f 6, f 7 ) Table 3 - Face List Face Vertices Edges f 0 (v 0, v 1, v 2 ) (e 0, e 1, e 2 ) f 2 (v 0, v 2, v 4 ) e 0, e 4, e 3 f 3 v 1, v 0, v 4 e 1, e 3, e 5 f 5 (v 2, v 1, v 5 ) e 2, e 7, e 6 f 6 (v 4, v 2, v 5 ) e 4, e 6, e 8 f 7 v 1, v 4, v 5 (e 5, e 8, e 7 ) Figure 1 A view of P 5 with labels 5

6 1.3 Polyhedron Class A class to maintain such lists will be introduced to hold all the information of a polyhedron, where a pointer is maintained to each of the three lists (Code 2). Loops over all vertices, edges, or faces all have the same basic structure, previously shown in Lab 3. This looping structure assumes that the lists are nonempty, which is indeed the case immediately after the initial polytope is built. Code 2 - Basic fields of Polyhedron class classdef Polyhedron vertexlist edgelist facelist % a pointer to the starting node of a linked list % of node type Vertex3D % a pointer to the starting node of a linked list % of node type Edge3D % a pointer to the starting node of a linked list % of node type Face3D Four basic list processing routines are needed for each of the three data structures: allocation of a new element (the constructor), freeing an element's memory (destructor), adding a new element to the list (insertafter), and deleting an old element (disconnect). These routines can be obtained from Vertex2D class in Lab 3 and incorporated in Vertex3D, Edge3D and Face3D classes. 1.4 Data Structures more details The fields of the basic data structures are augmented by several flags and auxiliary pointers, presented in Code 3 with the full structure definitions. The additional fields are all commented, and each will be explained further when first used. It is important to note that these classes still need their set and get functions, which are left for you to add. Code 3 - All fields of Vertex3D, Edge3D and Face3D classes classdef Vertex3D < handle vertexid point % this will contain the xyz coordinates of the vertex, % it will be of type Point3D duplicate % pointer to incident cone edge or null (of type Edge3D) onhull % true iff vertex on hull mark % true iff vertex already processed next % next vertex prev % prev vertex methods function obj = Vertex3D(vertexID,point) switch nargin, 6

7 case 0, obj.vertexid = -1; obj.point = []; obj.duplicate = []; obj.onhull = 0; obj.mark = 0; obj.prev = []; obj.next = []; case 1, obj.vertexid = vertexid; obj.point = Point2D(0,0); obj.duplicate = []; obj.onhull = 0; obj.mark = 0; obj.prev = []; obj.next = []; case 2, obj.vertexid = vertexid; obj.point = point; % it is of type Point3D obj.duplicate = []; obj.onhull = 0; obj.mark = 0; obj.prev = []; obj.next = []; classdef Edge3D < handle edgeid adjacentfaces % the two faces which share this edge % this is point to Face3D class. % it will be array of size two ingpoints % the two ing vertexs (Vertex3D) newface % pointer to incident cone face (Face3D) delete % true iff edge should be deleted next % next edge prev % prev edge methods function obj = Edge3D(edgeID) if nargin == 0 obj.edgeid = -1; obj.edgeid = edgeid; obj.adjacentfaces{1} = []; obj.adjacentfaces{2} = []; obj.newface = []; obj.ingpoints{1} = []; obj.ingpoints{2} = []; obj.delete = 0; 7

8 obj.prev = []; obj.next = []; classdef Face3D < handle faceid edges % array of three edges (Edge3D) constructing the face vertices % array of three vertices (Vertex3D) constructing the face visible % true iff face visible form new point next % next face prev % prev face methods function obj = Face3D(faceID) if nargin == 0 obj.faceid = -1; obj.faceid = faceid; obj.edges{1} = []; obj.edges{2} = []; obj.edges{3} = []; obj.vertices{1} = []; obj.vertices{2} = []; obj.vertices{3} = []; obj.visible = 0; obj.prev = []; obj.next = []; 2. Example: Cube In this section the running of the program is illustrated with the example started in the previous section, with input the eight comers of a cube. We will discuss each section of the code as it becomes relevant. We are given the eight corners of a cube as the points in 3D and we are required to construct the convex hull which encloses these points, which we know that it is already a cube. In doing so, we will use the Incremental Algorithm outlined as follows; Algorithm: 3D Incremental Algorithm Given a list of vertices (v 0, v 1,, v n 1 ). Initialize H 3 to tetrahedron (v 0, v 1, v 2, v 3 ). 8

9 For i = 4,, n 1 do For each face f of H i 1 do Compute the volume of tetrahedron determined by f and v i Mark f visible if and only if volume < 0 If no faces are visible Then Discard p i (it is inside H i 1 ) Else For each border edge e of H i 1 do Construct cone face determined by e and p i For each visible face f do Delete f Update H i 2.1 Main function The work is separated into four subsections at the top level: constructing vertex list, create initial polytope H 3, construct the hull H n, and print/draw intermediate hulls H i. Code 4 - main function function main % the vertices of the cube has the following coordinates x = [ ]; y = [ ]; z = [ ]; % initialization polyheron = Polyhedron(); % construct vertex list show = 1; polyheron = polyheron.constructvertexlist (x,y,z,show); % construct the intial polytope polyheron = polyheron.doubletriangle(); % go on and construct the hull polyheron = polyheron.constructhull('drawhandle',gca,'linewidth',2, 'ColorMarkerStyle','b','MarkerSize',20); 2.2 Vertex List Refer to Code 5 to see how we can construct the vertex list of the cube, note that it is one of the functions of the Polyhedron class. The vertices are labeled v 0, v 1,, v 7 as displayed previously in 9

10 Table 1. They are read in and formed into the vertex list vertices. The meaning of the various fields of each vertex record will be explained later. Code 5 constructvertexlist function classdef Polyhedron vertexlist % a pointer to the starting node of a linked list % of node type Vertex3D edgelist % a pointer to the starting node of a linked list % of node type Edge3D facelist % a pointer to the starting node of a linked list % of node type Face3D methods %% the constructor - called when you create an instance of this % class %% access methods %% construct vertex list function obj = constructvertexlist (obj,x,y,z,show) starting_point = Point3D(x(1),y(1),z(1)); if nargin == 3 show = 0; if show figure, view(3) % Create axes xlim([-2 12]); ylim([-2 12]); zlim([-2 12]); xlabel('x','fontweight','bold',... 'FontSize',12,... 'FontName','Garamond'); ylabel('y','fontweight','bold',... 'FontSize',12,... 'FontName','Garamond'); zlabel('z','fontweight','bold',... 'FontSize',12,... 'FontName','Garamond'); set(gca,'xtick',[-2:2:12],'ytick',[-2:2:12], 'ZTick',[-2:2:12]); grid on starting_point.draw('drawhandle',gca,... 'ColorMarkerStyle','r*:','LineWidth',2,'Label',['v_0']); hold on vertices = Vertex3D(0,starting_point); 1 0

11 z University of Louisville Instructor for i = 2 : length(x) curpoint = Point3D(x(i),y(i),z(i)); if show curpoint.draw('drawhandle',gca,... 'ColorMarkerStyle','r*:','LineWidth',2, 'Label',['v_' num2str(i-1)]); hold on curvertex = Vertex3D(i-1,curPoint); curvertex.insertafter(vertices); vertices = curvertex; % make it circular list vertices.next = vertices.gethead(); vertices = vertices.gotohead(); vertices.prev = gettail(vertices); obj.vertexlist = vertices; v 5 v 1 6 y v 4 v 0-2 Figure 2 Vertices of the cube 0 v 6 v x 6 v 7 v

12 2.3 Create the initial polytope The next and first substantial step is to create the initial polytope H 3. It is natural to start with a tetrahedron, as in the algorithm, but it was found that it is a bit easier to start with a doubly covered triangle (a d-triangle henceforth, technically a bihedron), which is a polyhedron with three vertices and two faces identical except in the order of their vertices, these can be viewed as the front and back faces of the same triangle. Although this is not a polyhedron according to the definition, it has the same local incidence structure as a polyhedron, which suffices for the code's immediate purposes. Given that the goal is construction of a d-triangle, one might think this task is trivial; but in fact the code is complicated and messy, for several reasons. First, it is not adequate to use simply the first three points in the vertex list, as those points might be collinear. Although we can tolerate the degeneracy of double coverage, a face with zero area will form zero-volume tetrahedra with subsequent points, something we cannot tolerate. So we must first find three non-collinear points. Of course, an assumption of general position would permit us to avoid this unpleasantness, but even the vertices of a cube are not in general position. Second, the data structures need to be constructed to have the appropriate. In particular, the counterclockwise ordering of the vertices in each face record must be ensured. This also seems unavoidable. Third, the data structures are somewhat unwieldy. I have no doubt this is avoidable with more sophisticated data structures. The d-triangle is constructed in three stages: 1. Three non-collinear points (v 0, v 1, v 2 ) are found. 2. The two faces f 0 and f 1 of the triangle are created and linked. 3. A fourth point v 3 not coplanar with (v 0, v 1, v 2 ) is found. Code 6 DoubleTriangle function classdef Polyhedron vertexlist % a pointer to the starting node of a linked list % of node type Vertex3D edgelist % a pointer to the starting node of a linked list % of node type Edge3D facelist % a pointer to the starting node of a linked list % of node type Face3D methods %% the constructor - called when you create an instance of this % class 1 2

13 %% access methods %% construct vertex list %% construct the double triangle function obj = DoubleTriangle(obj) % find three non-collinear points in the vertexlist v0 = obj.vertexlist ; % the first vertex of the vertexlist while Polyhedron.Collinear(v0,v0.next,v0.next.next) % as long as you find collinear vertices move on v0 = v0.next; if v0 == obj.vertexlist % you finished the vertexlist without finding non- % collinear points error('doubletriangle: All points are collinear...'); return; % now the three non-collinear points will be... v0 and v1 = v0.next; v2 = v1.next; % mark the vertices to be processed v0.mark = 1; v1.mark = 1; v2.mark = 1; % create the two twin faces f1 = []; obj = obj.makeface(v0,v1,v2,f1); f0 = obj.facelist; % the added face in the MakeFace function obj = obj.makeface(v2,v1,v0,f0); f1 = obj.facelist; % the added face in the MakeFace function % link adjacent face fields f0.edges{1}.adjacentfaces{1} = f1; f0.edges{2}.adjacentfaces{1} = f1; f0.edges{3}.adjacentfaces{1} = f1; f0.edges{1}.adjacentfaces{2} = f0; f0.edges{2}.adjacentfaces{2} = f0; f0.edges{3}.adjacentfaces{2} = f0; f1.edges{1}.adjacentfaces{1} = f0; f1.edges{2}.adjacentfaces{1} = f0; f1.edges{3}.adjacentfaces{1} = f0; f1.edges{1}.adjacentfaces{2} = f1; f1.edges{2}.adjacentfaces{2} = f1; f1.edges{3}.adjacentfaces{2} = f1; 1 3

14 % find a fourth non-coplanar point to form tetrahedron v3 = v2.next; vol = Polyhedron.VolumeSign(f0,v3); while ~vol v3 = v3.next; if v3 == v0 error('doubletriangle: All points are coplanar'); return; vol = Polyhedron.VolumeSign(f0,v3); % insure that v3 will be the first added, % hence the vertexlist will start from v3 obj.vertexlist = v3; We now discuss each stage of DoubleTriangle (Code 6) in more detail. 1. Three non-collinear points. It suffices to check all triples of three consecutive points in the vertex list. If not all points are collinear, at least one of these triples must be non-collinear. Collinearity is checked by the same method used in Lab 3, but now because the points are in three dimensions, hence we cannot rely solely on the z coordinate of the cross product. Since any triangle can be viewed as half of a parallelogram, this gives an immediate method of computing the area from vertices coordinates (a, b, c). Just let A = b a and B = c a. Then the area is half the length of A B. The cross product can be computed from the following determinant, where i, j and k are unit vectors in the x, y, and z directions respectively: i j k A 0 A 1 A 2 = A 1 B 2 A 2 B 1 i A 2 B 0 A 0 B 2 j + A 0 B 1 A 1 B 0 k B 0 B 1 B 2 Therefore, the area of the triangle determined by the three points (a, b, c) is zero if and only if each component of the cross is zero. This is implemented in Code 7. Code 7 Collinear function classdef Polyhedron vertexlist % a pointer to the starting node of a linked list % of node type Vertex3D edgelist % a pointer to the starting node of a linked list % of node type Edge3D facelist % a pointer to the starting node of a linked list 1 4

15 % of node type Face3D methods (Static) function iscollinear = Collinear (a,b,c) % the three points a = a.point; b = b.point; c = c.point; % vectors joining the points A = b-a; B = c-a; if ((A.y*B.z-A.z*B.y)==0) &&... ((A.z*B.x-A.x*B.z)==0) &&... ((A.x*B.y-A.y*B.x)==0) iscollinear = 1; iscollinear = 0; 2. Face construction. Each face is created by the routine MakeFace, which takes three vertex pointers as input and one face pointer f old (Code 8). It constructs a face pointing to those three vertices. If the face pointer f old is not NULL (empty), it uses it to access the edge pointers. This is tricky but not deep: The goal is to fill the face record with three vertex pointers in the order passed, and with three edge pointers, either constructed de novo (for the first triangle) or copied from f old (for the second triangle), and finally to link the adjacent face fields of each edge. Note that achieving an initially correct orientation for each face is easy: One face uses v 0, v 1, v 2 and the other (v 2, v 1, v 0 ). Code 8 MakeFace function classdef Polyhedron vertexlist % a pointer to the starting node of a linked list % of node type Vertex3D edgelist % a pointer to the starting node of a linked list % of node type Edge3D facelist % a pointer to the starting node of a linked list % of node type Face3D methods %% the constructor - called when you create an instance of this % class 1 5

16 %% access methods %% construct vertex list %% making new face function obj = MakeFace(obj,v0,v1,v2,fold) % create edges of the initial triangle if isempty(fold) % construct new edges if isempty(obj.edgelist) id = -1; id = obj.edgelist.getnoofedges()-1; % zero-based id e0 = Edge3D(id+1); e1 = Edge3D(id+2); e2 = Edge3D(id+3); % the edges will be the edges of a face previously created % (fold) e0 = fold.edges{3}; e1 = fold.edges{2}; e2 = fold.edges{1}; % set the ing points of the edges e0.ingpoints{1} = v0; e0.ingpoints{2} = v1; e1.ingpoints{1} = v1; e1.ingpoints{2} = v2; e2.ingpoints{1} = v2; e2.ingpoints{2} = v0; % create face for the triangle % get the id of the new face if isempty(obj.facelist) id = -1; id = obj.facelist.getnooffaces()-1; % zero-based id newface = Face3D(id+1); % set its vertices newface.vertices{1} = v0; newface.vertices{2} = v1; newface.vertices{3} = v2; % link edges to face e0.adjacentfaces{1} = newface; e1.adjacentfaces{1} = newface; e2.adjacentfaces{1} = newface; 1 6

17 % set its edges newface.edges{1} = e0; newface.edges{2} = e1; newface.edges{3} = e2; if isempty(fold) % add the edges to the edge list if isempty(obj.edgelist) obj.edgelist = e0; e0.insertafter(obj.edgelist); obj.edgelist = e0; % pointer to the latest added edge e1.insertafter(obj.edgelist); obj.edgelist = e1; % pointer to the latest added edge e2.insertafter(obj.edgelist); obj.edgelist = e2; % pointer to the latest added edge % adding the face to the facelist if isempty(obj.facelist) obj.facelist = newface; newface.insertafter(obj.facelist); obj.facelist = newface; % pointer to the latest added face 3. Fourth non-coplanar point. A non-coplanar point is found by searching for a v 3 such that the volume of the tetrahedron v 0, v 1, v 2, v 3 is nonzero. Once this is found, the head pointer of the vertexlist is repositioned to v 3 so that this will be the first point added. This strategy is used so that we can be assured of reaching a legitimate nonzero-volume polyhedron on the next step. To permit it to grow in a plane would make orientation computations difficult. Recall: Using the determinant form to compute the area of a triangle has the advantage that it can be exted directly into higher dimensions. In three dimensions, the volume of a tetrahedron t with vertices a, b, c, d can be written as follows: 6V t = a x a y a z 1 b x b y b z 1 c x c y c z 1 d x d y d z 1 1 7

18 This volume is signed, that is it is positive if (a, b, c) are in a counterclockwise orientation when view from the side away from d, so that the face normal determined by the right-hand rule points toward the outside. The volume can be computed by a straightforward expansion of this determinant into an algebraic expression. We choose to express the computation differently as that used in VolumeSign (Code 9) is algebraically equivalent but uses fewer multiplications. It derives from translating the tetrahedron so that the p-corner is placed at the origin. The individual coordinates are tediously assigned to many distinct variables to make it easier to transcribe the volume equation without error. Note that the function returns an integer in {-1, 0, +1}. Code 9 VolumeSign function classdef Polyhedron vertexlist % a pointer to the starting node of a linked list % of node type Vertex3D edgelist % a pointer to the starting node of a linked list % of node type Edge3D facelist % a pointer to the starting node of a linked list % of node type Face3D methods (Static) % collinear function % getting the volume of a tetrahedron defined by a face and a % vertex function vol = VolumeSign (face,vertex) ax = face.vertices{1}.point.x - vertex.point.x; ay = face.vertices{1}.point.y - vertex.point.y; az = face.vertices{1}.point.z - vertex.point.z; bx = face.vertices{2}.point.x - vertex.point.x; by = face.vertices{2}.point.y - vertex.point.y; bz = face.vertices{2}.point.z - vertex.point.z; cx = face.vertices{3}.point.x - vertex.point.x; cy = face.vertices{3}.point.y - vertex.point.y; cz = face.vertices{3}.point.z - vertex.point.z; vol = ax * (by*cz - bz*cy) +... ay * (bz*cx - bx*cz) +... az * (bx*cy - by*cx); if vol > 0.5 vol = 1; if vol < -0.5 vol = -1; vol = 0; 1 8

19 When DoubleTriangle is run on our cube example, the first three vertices tried are non-collinear: v 0, v 1, v 2 (in fact, no three points of the input are collinear). Faces f 0 and f 1 are then constructed; f 1 will be deleted later in the processing. The first candidate tried for v3 is v 3 (Table 1), which is in fact coplanar with (v 0, v 1, v 2 ). The head pointer vertexlist is set to v 4, which is not coplanar, and the stage is set for the first point to be added by the incremental algorithm. 2.4 Construct the hull We now come to the heart of the algorithm. It is instructive to note how much "peripheral' code is needed to reach this point. The routine ConstructHull (Code 10) is called by main after the initial polytope is constructed, and it simply adds each point one at a time with the function AddOne. One minor feature to note: The entire list of vertices is processed using the mark field to avoid points already processed. It would not be possible to simply pick up in the vertex list where the initial DoubleTriangle procedure left off, because the vertices comprising that d-triangle might be spread out in the list. After each point is added to the previous hull, an important routine CleanUp is called. This deletes superfluous parts of the data structure and prepares for the next iteration. We discuss this in detail below. Code 10 ConstructHull function classdef Polyhedron vertexlist % a pointer to the starting node of a linked list % of node type Vertex3D edgelist % a pointer to the starting node of a linked list % of node type Edge3D facelist % a pointer to the starting node of a linked list % of node type Face3D methods %% the constructor - called when you create an instance of this % class %% access methods %% construct vertex list 1 9

20 %% making new face %% construct initial polytope (DoubleTriangle) % construct the hull function obj = ConstructHull(obj,varargin) % start where DoubleTriangle left v = obj.vertexlist; startingid = v.vertexid; obj.draw(varargin{:}); pause(0.5); while(1) vnext = v.next; if ~v.mark v.mark = 1; obj = obj.addone(v); obj = obj.cleanup(); cla obj.draw_vertices(); obj.draw(varargin{:}); pause(0.5); v = vnext; if v.vertexid == startingid % returned to where we started break; AddOne The primary work of the algorithm is accomplished in the procedure AddOne (Code 11), which adds a single point p to the hull, constructing the new cone of faces if p is exterior. There are two steps to this procedure: 1. Determine which faces of the previously constructed hull are "visible" to p. Recall that face f is visible to p if and only if p lies strictly in the positive half-space determined by f, where, as usual, the positive side is determined by the counterclockwise orientation of f. The strictness condition is a crucial subtlety: We do not consider a face visible if p illuminates it edge-on. The visibility condition is determined by a volume calculation (discussed before): f is visible from p if and only if the volume of the tetrahedron determined by f and p is negative. 2 0

21 If no face is visible from p, then p must lie inside the hull, and it is marked for subsequent deletion. Recall that the volume is positive when p is on the negative side of f with the positive side determined by the right-hand rule. Consider adding the point v 6 = (10, 10, 10) to the polytope P 5 in Figure 1. It can see facef 6, whose vertices in counterclockwise order "from the outside" are (v 4, v 2, v 5 ). The determinant of f 6 and v 6 is: = 1000 < 0 This negative volume is interpreted in AddOne as indicating that v 6 can see f Add a cone of faces to p. The portion of the polytope visible from p forms a connected region on the surface. The interior of this region must be deleted, and the cone connected to its boundary. Each edge of the hull is examined in turn. Those edges whose two adjacent faces are both marked visible are known to be interior to the visible region. They are marked for subsequent deletion (but are not deleted yet). Edges with just one adjacent visible face are known to be on the border of the visible region. These are precisely the ones that form the base of a new triangle face apexed at p. The (considerable) work of constructing this new face is handled by MakeConeFace.. One tricky aspect of this code is that we are looping over all edges at the same time as new edges are being added to the list by MakeConeFace (as we will see). Recall that all edges are inserted immediately prior to the head of the list, edges. Thus the newly created edges are reprocessed by the loop. But both halves of the if-statement fail for these edges, because their adjacent faces are created with their visible flag set to 0. AddOne is written to return 1 or 0 deping on whether the hull is modified or not, but the version of the code shown does not use this Boolean value. Code 11 AddOne function classdef Polyhedron vertexlist % a pointer to the starting node of a linked list % of node type Vertex3D edgelist % a pointer to the starting node of a linked list % of node type Edge3D facelist % a pointer to the starting node of a linked list % of node type Face3D methods 2 1

22 %% the constructor - called when you create an instance of this % class %% access methods %% construct vertex list %% making new face %% construct initial polytope (DoubleTriangle) % construct the hull % add one more vertex to the current convex hull function obj = AddOne(obj,p) % mark faces visible from p f = obj.facelist.gethead(); vis = 0; while(1) vol = Polyhedron.VolumeSign(f,p); if vol < 0 f.visible = 1; vis = 1; f = f.next; if isempty(f) break; % if no faces are visible from p then p is inside the hull if ~vis p.onhull = 0; return % mark edges in interior of visible region for deletion, erect % a new face based on each border edge e = obj.edgelist.gethead(); while(1) enext = e.next; if (~isempty(e.adjacentfaces{1}))&&... (~isempty(e.adjacentfaces{2})) if e.adjacentfaces{1}.visible &&... e.adjacentfaces{2}.visible % e is interior: mark for deletion e.delete = 1; if e.adjacentfaces{1}.visible... e.adjacentfaces{2}.visible % e is on border, make a new face obj = obj.makeconeface(e,p); 2 2

23 if ((~isempty(e.adjacentfaces{1})) &&... e.adjacentfaces{1}.visible)... ((~isempty(e.adjacentfaces{2})) &&... e.adjacentfaces{2}.visible) % e is on border, make a new face obj = obj.makeconeface(e,p); e = enext; if isempty(e) break AddOne: Cube Example. Before discussing the routines employed by AddOne, we illustrate its functioning with the cube example. The first three vertices in the vertex list were marked by DoubleTriangle: v 0, v 1, v 2. As discussed previously, the head pointer maintained by vertexlist is moved to v 4 because v 3 is coplanar with those first three vertices. The vertices are then added in the order v 4, v 5, v 6, v 7, v 3. Let P i be the polytope after adding vertex v i. The polytopes are then produced in the order P 2, P 4, P 5, P 6, P 7 and P 3. They are shown in Figure 3(a)-(f). Let us look at the P 5 to P 6 transition, caused by the addition of v 6. As is evident from Figure 3(c) (see also Figure 1), v 6 can only see the face: f 6 = (v 4, v 2, v 5 ). The visibility calculation computes the volume of the tetrahedra formed by v 6 with all the faces of P 5, returning -1 for f 6 (as we just detailed), +1 for faces f 0, f 3 and f 7, and 0 for f 2 and f 5. Note that the code does not mark the two coplanar faces f 2 and f 5 as visible, per our definition of visibility. The second part of AddOne finds no edges in the interior of the visible region, since it consists solely of f 6. And it finds that each of f 6 's edges, (e 4, e 6, e 8 ) are border edges, and so constructs three new faces with those as bases: f 8, f 9 and f 10, Initially these faces are linked into the field e.newface, permitting the old hull data structure to maintain its integrity as the cone is being added. This permits the old structure to be interrogated by MakeConeFace while the new is being built. Only after the entire cone is attached are the data structures cleaned up with CleanUp. 2 3

24 Coplanarity Revisited: Figure 3 (a) P 2, (b) P 4, (c) P 5, (d) P 6, (e) P 7, (f) P 3 To return to the issue of coplanarity, note that if we considered f 2 visible from v 6, then two of f 2 's edges (e 0 and e 3 ) would become boundary edges, and e 4 would be interior to the visible region. The cone would then be based on four edges rather than three. So our decision to treat coplanar faces as invisible makes the visible region, and therefore the new cone, as small as possible. There are two reasons for treating vol = 0 faces as invisible: 1. The changes to the data structure are minimized, since, as just explained, the visible region is minimized. 2. Points that fall on a face of the old hull are discarded. Note that if we treated zero-volume faces as visible, a point in the interior of a face would see that face and thus would up needlessly fracturing it into new faces. Although this treatment of visibility avoids inserting new points in the interior of old faces, it does not avoid all unnecessary coplanar points: If the interior point is encountered in the construction first, it will never be deleted later. An unfortunate consequence is that, unlike our code for Graham's two-dimensional hull algorithm, the three-dimensional hull code can produce different outputs for different permutations of the same input points. Invariance with respect to permutations could be achieved by postprocessing to delete unnecessary coplanar points. 2 4

25 Two major pieces of the code remain to be explained, both managing the data structures: MakeConeFace and CleanUp. MakeConeFace The routine MakeConeFace (Code 12) takes an edge e and a point p as input and creates a new face spanned by e and p and two new edges between p and the points of e. The created structures are linked together properly. This is mostly straightforward, but there are two complications. First, the creation of duplicate edges must be avoided. Because we have chosen not to structure the border of the visible region, the faces of the cone are constructed in an arbitrary order. Once one face of the cone and its edges have been created, subsequent faces might share two, one, or no edges with previously created faces. The mechanism we use to detect this is as follows. Each time an edge e i is created with one at p and the other at a vertex v on the old hull, a field of v's record, v.duplicate, points to e i. For any vertex not incident to a constructed cone edge, the duplicate field is NULL. Note that each vertex is incident to at most one cone edge. For every edge e on the border of the visible region, a new face f is always created. But a new edge e for f is only created if the duplicate field of the v-point of e is NULL. If one is not NULL, then the already-created cone edge pointed to by that field is used to fill the appropriate edge field of f. Code 12 MakeConeFace function classdef Polyhedron vertexlist % a pointer to the starting node of a linked list % of node type Vertex3D edgelist % a pointer to the starting node of a linked list % of node type Edge3D facelist % a pointer to the starting node of a linked list % of node type Face3D methods %% the constructor - called when you create an instance of this % class %% access methods %% construct vertex list %% making new face %% construct initial polytope (DoubleTriangle) % construct the hull 2 5

26 % add one more vertex to the current convex hull function obj = MakeConeFace(obj,e,p) % this function takes a point and an edge and makes a new face % spanned by e and p and two new edges between p and the % points of e, a pointer to the face is returned and the % created structures are linked together properly new_edges{1} = Edge3D(); % edge from p to the first point of e new_edges{2} = Edge3D(); % edge from p to the second point of e % make two new edges if they don't already exist for i = 1 : 2 % if the edge exists, copy it into a new edge %new_edges{i} = e.ingpoints{i}.duplicate; if isempty(e.ingpoints{i}.duplicate) % duplicate is null, make a new edge new_edges{i}.ingpoints{1} = e.ingpoints{i}; new_edges{i}.ingpoints{2} = p; e.ingpoints{i}.duplicate = new_edges{i}; duplicate = 0; new_edges{i} = e.ingpoints{i}.duplicate; duplicate = 1; % add the edge to the edgelist if not duplicated % construct new edges if ~duplicate if isempty(obj.edgelist) id = -1; id = obj.edgelist.getnoofedges()-1; % zero-based id new_edges{i}.edgeid = id+1; if isempty(obj.edgelist) obj.edgelist = new_edges{i}; new_edges{i}.insertafter(obj.edgelist); obj.edgelist = new_edges{i}; % pointer to the latest added edge % now make the new face if isempty(obj.facelist) id = -1; id = obj.facelist.getnooffaces()-1; % zero-based id 2 6

27 newface = Face3D(id+1); newface.edges{1} = e; newface.edges{2} = new_edges{1}; newface.edges{3} = new_edges{2}; newface = obj.makeccw(newface,e,p); if isempty(obj.facelist) obj.facelist = newface; newface.insertafter(obj.facelist); obj.facelist = newface; % pointer to the latest added face % set the adjacent face points for i = 1 : 2 for j = 1 : 2 % only one null link should be set to new face if isempty(new_edges{i}.adjacentfaces{j}) new_edges{i}.adjacentfaces{j} = newface; break e.newface = newface; The second complication in MakeConeFace is the need to arrange the array elements in the vertex field of f in counterclockwise order. This is handled by the somewhat tricky routine MakeCcw. The basic idea is simple: Assuming that the old hull has its faces oriented properly, make the new faces consistent with the old orientation. In particular, a cone face f can inherit the same orientation as the visible face adjacent to the edge e of the old hull that forms its base. This follows because the new face hides the old and is in a sense a replacement for it; so it naturally assumes the same orientation. It is here that the most awkward aspect of our choice of data structure makes itself evident. Because e is oriented arbitrarily, we have to figure out how e is directed with respect to the orientation of the visible face, that is, which vertex pointer i of the visible face points to the "base" (1)- of e. We can then anchor decisions from this index i. Although not needed in the code as displayed, we also swap the edges of the new face f to follow the same orientation. Because e was set to be edge(1) in MakeConeFace, we swap edge(2) with edge(3) when they run against the orientation of the visible face. See Code

28 Code 13 MakeCcw function classdef Polyhedron vertexlist % a pointer to the starting node of a linked list % of node type Vertex3D edgelist % a pointer to the starting node of a linked list % of node type Edge3D facelist % a pointer to the starting node of a linked list % of node type Face3D methods %% the constructor - called when you create an instance of this % class %% access methods %% construct vertex list %% making new face %% construct initial polytope (DoubleTriangle) % construct the hull % add one more vertex to the current convex hull % make cone face % make counter clockwise face function newface = MakeCcw(obj,newface,e,p) if ~isempty(e.adjacentfaces{1}) if e.adjacentfaces{1}.visible fv = e.adjacentfaces{1}.clone(); % the visible face adjacent to e fv = e.adjacentfaces{2}.clone(); % the visible face adjacent to e % set the first two vertices of the new face to have the same % orientation as do the corresponding vertices of fv for i = 1:3 if fv.vertices{i} == e.ingpoints{1} break; % orient the new face the same as fv if fv.vertices{mod(i+1,3)+1} ~= e.ingpoints{2} newface.vertices{1} = e.ingpoints{1}; newface.vertices{2} = e.ingpoints{2}; 2 8

29 newface.vertices{1} = e.ingpoints{2}; newface.vertices{2} = e.ingpoints{1}; e1 = newface.edges{2}; newface.edges{2} = newface.edges{3}; newface.edges{3}= e1; newface.vertices{3} = p; CleanUp Just prior to calling CleanUp after AddOne, the new hull has been constructed: All the faces and edges and one new vertex are linked to each other and to the old structures properly. However, the cone is "glued on" to the old structures via the newface fields of edges on the border of the visible region. Moreover, the portion of the old hull that is now inside the cone needs to be deleted. The purpose of CleanUp is to "clean up" the three data structures to represent the new hull exactly and only, thereby preparing the structures for the next iteration. This task is less straightforward than one might expect. We partition the work into three natural groups (Code 414): cleaning up the vertex, the edge, and the face lists. But the order in which the three are processed is important. It easiest to decide which faces are to be deleted: those marked f.visible. Edges to delete require an inference, made earlier and recorded in e.delete: Both adjacent faces are visible. Vertices to delete require the most work: These vertices have no incident edges on the new hull. Code 14 CleanUp function classdef Polyhedron vertexlist % a pointer to the starting node of a linked list % of node type Vertex3D edgelist % a pointer to the starting node of a linked list % of node type Edge3D facelist % a pointer to the starting node of a linked list % of node type Face3D methods %% the constructor - called when you create an instance of this % class %% access methods %% construct vertex list %% making new face 2 9

30 %% construct initial polytope (DoubleTriangle) % construct the hull % add one more vertex to the current convex hull % make cone face % make counter clockwise face % clean up function function obj = CleanUp(obj) obj = obj.cleanedges(); obj = obj.cleanfaces(); obj = obj.cleanvertices(); We first describe CleanFaces (Code 15), which is a straight deletion of all faces marked visible, meaning visible from the new point just added, and therefore inside the new hull. There is one minor coding feature to note. Normally our loops over all elements of a list start with the head and stop the while when the head is encountered again. But suppose, for example. that the first two elements A and B of the faces list are both visible, and so should be deleted. Starting with f = facelist, the element f = A is deleted, f is set to B, and then facelist will point to B also. Now if we used the standard loop termination while ( f! = facelist ), it would appear that we are finished when in fact we are not. This problem is skirted by repeatedly deleting the head of the list (if appropriate) and only starting the general loop when we are assured that reencountering the head of the list really does indicate proper loop termination. The same strategy is used for deletion in CleanEdges and CleanVertices. Recall that it is the border edges of the visible region to which the newly added cone is attached. For each of these border edges, CleanEdges (Code 15) copies newface into the appropriate adjacent face field. The reason that CleanEdges is called prior to CleanFaces is that we need to access the visible field of the adjacent faces to decide which to overwrite. So the old faces must be around to properly integrate the new. Second, CleanEdges deletes all edges that were previously marked for deletion (by the routine AddOne). The vertices to delete are not flagged by any routine invoked earlier. But we have called CleanEdges first so that we can infer that a vertex is strictly in the interior of the visible region if it has no incident edges: Those interior edges have all been deleted by now. Hence in CleanVertices (Code 15) we run through the edge list, marking each vertex that is an point as on the hull in the v->onhull field. And then a vertex loop deletes all those points already processed but not on the hull. Finally, 3 0

31 the various flags in the vertex record are reset. This completes the description of the code. As should be evident, there is a significant gap between the relatively straightforward algorithm and the reality of an actual implementation. Code 15 CleanEdges, CleanFaces and CleanVertices functions classdef Polyhedron vertexlist % a pointer to the starting node of a linked list % of node type Vertex3D edgelist % a pointer to the starting node of a linked list % of node type Edge3D facelist % a pointer to the starting node of a linked list % of node type Face3D methods %% the constructor - called when you create an instance of this % class %% access methods %% construct vertex list %% making new face %% construct initial polytope (DoubleTriangle) % construct the hull % add one more vertex to the current convex hull % make cone face % make counter clockwise face % clean up function function obj = CleanEdges(obj) % integrate the new faces into the data structure % check every edge e = obj.edgelist.gethead(); while(1) if ~isempty(e.newface) if e.adjacentfaces{1}.visible e.adjacentfaces{1} = e.newface; e.adjacentfaces{2} = e.newface; e.newface = []; e = e.next; if isempty(e) break; % reach to the of edgelist 3 1

32 % delete any edges marked for deletion edges = obj.edgelist.gethead(); while (~isempty(edges) && edges.delete) oldedge = edges; edges = edges.next; delete(oldedge); edges.prev = []; % now we are on the first can't be deleted edge in the edgelist % whose prev set to null to indicate that it is a head e = edges.next; while(1) if e.delete oldedge = e; if isempty(e.next) % this is the tail to be disconnected obj.edgelist = e.prev; obj.edgelist.next = []; e = e.next; disconnect(oldedge); e = e.next; disconnect(oldedge); obj.edgelist = e; e = e.next; if isempty(e) % no next element, of list break function obj = CleanFaces(obj) faces = obj.facelist.gethead(); while (~isempty(faces) && faces.visible) oldface = faces; faces = faces.next; delete(oldface); faces.prev = []; % now we are on the first can't be deleted face in the facelist % whose prev set to null to indicate that it is a head f = faces.next; while(1) if f.visible oldface = f; if isempty(f.next) % this is the tail to be disconnected obj.facelist = f.prev; 3 2

33 obj.facelist.next = []; f = f.next; disconnect(oldface); f = f.next; disconnect(oldface); obj.facelist = f; f = f.next; if isempty(f) % no next element, of list break obj.facelist = obj.facelist.gethead(); function obj = CleanVertices(obj) % mark all vertices incident to some undeleted edge as on the % hull e = obj.edgelist.gethead(); while(1) e.ingpoints{1}.onhull = 1; e.ingpoints{2}.onhull = 1; e = e.next; if isempty(e) break; % delete all vertices that have been processed but are not on % the hull vertices = obj.vertexlist.gethead(); while (~isempty(vertices) && vertices.mark && ~vertices.onhull) oldvertex = vertices; vertices = vertices.next; delete(oldvertex); vertices.prev = []; % now we are on the first can't be deleted vertex in the % vertexlist % whose prev set to null to indicate that it is a head v = vertices.next; while(1) if v.mark && ~v.onhull oldvertex = v; if isempty(v.next) % this is the tail to be disconnected obj.vertexlist = v.prev; obj.vertexlist.next = []; v = v.next; disconnect(oldvertex); 3 3

34 v = v.next; disconnect(oldvertex); obj.vertexlist = v; v = v.next; if v == vertices.next break obj.vertexlist = obj.vertexlist.gethead(); % reset flags v = obj.vertexlist.gethead(); while(1) v.duplicate = []; v.onhull = 0; v = v.next; if v == obj.vertexlist.gethead() break obj.vertexlist = v; 3. Now time for tasks It is not feasible to hope that a program as complex as the foregoing will work correctly upon first implementation. Hence we need a clean bill of our program correctness to give us some confidence. Task 1: The following tests can be run after each iteration to check for consistency, report your results using the given eight vertices. 1. Face orientations: Check that the points of each edge occur in opposite orders in the two faces adjacent to that edge. 2. Convexity: Check that each face of the hull forms a nonnegative volume with each vertex of the hull. 3. Euler's relations: Check that F = 2V - 4 and 2E = 3V. Task 2: Generate random points uniformly distributed inside a cube and random points uniformly distributed near the surface of a sphere, where most of the points in a cube do not up on the hull, whereas a large portion of the points near the sphere sutface are part of the hull. Construct the convex hull using the code given, report timing results for different number of points/vertices, e.g. n 3 4

35 = 100, 1000, 10, 000. Conclude whether the time performance really dep on the number of points or their distribution, also report number of vertices, edges and faces of the constructed convex hull in each case. Task 3: Write a report to summarize the theoretical background needed for this lab and your experimental results. Your report should begin with a cover page introducing the project title and group members. It is important to note that all figure axes should be labeled properly. You are required to submit your MATLAB codes (fully commented) with a readme file describing your files and how to use them in terms of input and output. Good Luck 3 5

Convex Hulls in Three Dimensions. Polyhedra

Convex Hulls in Three Dimensions. Polyhedra Convex Hulls in Three Dimensions Polyhedra Polyhedron 1.A polyhedron is the generalization of a 2- D polygon to 3-D A finite number of flat polygonal faces The boundary or surface of a polyhedron - Zero-dimensional

More information

Polygon Triangulation

Polygon Triangulation Polygon Triangulation Definition Simple Polygons 1. A polygon is the region of a plane bounded by a finite collection of line segments forming a simple closed curve. 2. Simple closed curve means a certain

More information

3D convex hulls. Computational Geometry [csci 3250] Laura Toma Bowdoin College

3D convex hulls. Computational Geometry [csci 3250] Laura Toma Bowdoin College 3D convex hulls Computational Geometry [csci 3250] Laura Toma Bowdoin College Convex Hulls The problem: Given a set P of points, compute their convex hull 2D 3D 2D 3D polygon polyhedron Polyhedron region

More information

Lofting 3D Shapes. Abstract

Lofting 3D Shapes. Abstract Lofting 3D Shapes Robby Prescott Department of Computer Science University of Wisconsin Eau Claire Eau Claire, Wisconsin 54701 robprescott715@gmail.com Chris Johnson Department of Computer Science University

More information

Pebble Sets in Convex Polygons

Pebble Sets in Convex Polygons 2 1 Pebble Sets in Convex Polygons Kevin Iga, Randall Maddox June 15, 2005 Abstract Lukács and András posed the problem of showing the existence of a set of n 2 points in the interior of a convex n-gon

More information

3D convex hulls. Computational Geometry [csci 3250] Laura Toma Bowdoin College

3D convex hulls. Computational Geometry [csci 3250] Laura Toma Bowdoin College 3D convex hulls Computational Geometry [csci 3250] Laura Toma Bowdoin College Convex Hull in 3D The problem: Given a set P of points in 3D, compute their convex hull convex polyhedron 2D 3D polygon

More information

1. CONVEX POLYGONS. Definition. A shape D in the plane is convex if every line drawn between two points in D is entirely inside D.

1. CONVEX POLYGONS. Definition. A shape D in the plane is convex if every line drawn between two points in D is entirely inside D. 1. CONVEX POLYGONS Definition. A shape D in the plane is convex if every line drawn between two points in D is entirely inside D. Convex 6 gon Another convex 6 gon Not convex Question. Why is the third

More information

Geometric Algorithms in Three Dimensions Tutorial. FSP Seminar, Strobl,

Geometric Algorithms in Three Dimensions Tutorial. FSP Seminar, Strobl, Geometric Algorithms in Three Dimensions Tutorial FSP Seminar, Strobl, 22.06.2006 Why Algorithms in Three and Higher Dimensions Which algorithms (convex hulls, triangulations etc.) can be generalized to

More information

Flavor of Computational Geometry. Convex Hull in 2D. Shireen Y. Elhabian Aly A. Farag University of Louisville

Flavor of Computational Geometry. Convex Hull in 2D. Shireen Y. Elhabian Aly A. Farag University of Louisville Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag University of Louisville February 2010 Agenda Introduction Definitions of Convexity and Convex Hulls Naïve Algorithms

More information

Chapter 4 Concepts from Geometry

Chapter 4 Concepts from Geometry Chapter 4 Concepts from Geometry An Introduction to Optimization Spring, 2014 Wei-Ta Chu 1 Line Segments The line segment between two points and in R n is the set of points on the straight line joining

More information

Interactive Math Glossary Terms and Definitions

Interactive Math Glossary Terms and Definitions Terms and Definitions Absolute Value the magnitude of a number, or the distance from 0 on a real number line Addend any number or quantity being added addend + addend = sum Additive Property of Area the

More information

Rubber bands. Chapter Rubber band representation

Rubber bands. Chapter Rubber band representation Chapter 1 Rubber bands In the previous chapter, we already used the idea of looking at the graph geometrically, by placing its nodes on the line and replacing the edges by rubber bands. Since, however,

More information

1 The Platonic Solids

1 The Platonic Solids 1 The We take the celebration of Dodecahedron Day as an opportunity embark on a discussion of perhaps the best-known and most celebrated of all polyhedra the Platonic solids. Before doing so, however,

More information

CS 532: 3D Computer Vision 14 th Set of Notes

CS 532: 3D Computer Vision 14 th Set of Notes 1 CS 532: 3D Computer Vision 14 th Set of Notes Instructor: Philippos Mordohai Webpage: www.cs.stevens.edu/~mordohai E-mail: Philippos.Mordohai@stevens.edu Office: Lieb 215 Lecture Outline Triangulating

More information

CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension

CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension Antoine Vigneron King Abdullah University of Science and Technology November 7, 2012 Antoine Vigneron (KAUST) CS 372 Lecture

More information

Planar Graphs. 1 Graphs and maps. 1.1 Planarity and duality

Planar Graphs. 1 Graphs and maps. 1.1 Planarity and duality Planar Graphs In the first half of this book, we consider mostly planar graphs and their geometric representations, mostly in the plane. We start with a survey of basic results on planar graphs. This chapter

More information

Computational Geometry Lab: SEARCHING A TETRAHEDRAL MESH

Computational Geometry Lab: SEARCHING A TETRAHEDRAL MESH Computational Geometry Lab: SEARCHING A TETRAHEDRAL MESH John Burkardt Information Technology Department Virginia Tech http://people.sc.fsu.edu/ jburkardt/presentations/cg lab search tet mesh.pdf December

More information

Question. Why is the third shape not convex?

Question. Why is the third shape not convex? 1. CONVEX POLYGONS Definition. A shape D in the plane is convex if every line drawn between two points in D is entirely inside D. Convex 6 gon Another convex 6 gon Not convex Question. Why is the third

More information

BMO Round 1 Problem 6 Solutions

BMO Round 1 Problem 6 Solutions BMO 2005 2006 Round 1 Problem 6 Solutions Joseph Myers November 2005 Introduction Problem 6 is: 6. Let T be a set of 2005 coplanar points with no three collinear. Show that, for any of the 2005 points,

More information

EXTREME POINTS AND AFFINE EQUIVALENCE

EXTREME POINTS AND AFFINE EQUIVALENCE EXTREME POINTS AND AFFINE EQUIVALENCE The purpose of this note is to use the notions of extreme points and affine transformations which are studied in the file affine-convex.pdf to prove that certain standard

More information

(Refer Slide Time: 00:02:00)

(Refer Slide Time: 00:02:00) Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 18 Polyfill - Scan Conversion of a Polygon Today we will discuss the concepts

More information

My Favorite Problems, 4 Harold B. Reiter University of North Carolina Charlotte

My Favorite Problems, 4 Harold B. Reiter University of North Carolina Charlotte My Favorite Problems, 4 Harold B Reiter University of North Carolina Charlotte This is the fourth of a series of columns about problems I am soliciting problems from the readers of M&I Quarterly I m looking

More information

Computational Geometry

Computational Geometry Lecture 1: Introduction and convex hulls Geometry: points, lines,... Geometric objects Geometric relations Combinatorial complexity Computational geometry Plane (two-dimensional), R 2 Space (three-dimensional),

More information

9. Visible-Surface Detection Methods

9. Visible-Surface Detection Methods 9. Visible-Surface Detection Methods More information about Modelling and Perspective Viewing: Before going to visible surface detection, we first review and discuss the followings: 1. Modelling Transformation:

More information

Linear Programming in Small Dimensions

Linear Programming in Small Dimensions Linear Programming in Small Dimensions Lekcija 7 sergio.cabello@fmf.uni-lj.si FMF Univerza v Ljubljani Edited from slides by Antoine Vigneron Outline linear programming, motivation and definition one dimensional

More information

Flavor of Computational Geometry. Voronoi Diagrams. Shireen Y. Elhabian Aly A. Farag University of Louisville

Flavor of Computational Geometry. Voronoi Diagrams. Shireen Y. Elhabian Aly A. Farag University of Louisville Flavor of Computational Geometry Voronoi Diagrams Shireen Y. Elhabian Aly A. Farag University of Louisville March 2010 Pepperoni Sparse Pizzas Olive Sparse Pizzas Just Two Pepperonis A person gets the

More information

The convex hull of a set Q of points is the smallest convex polygon P for which each point in Q is either on the boundary of P or in its interior.

The convex hull of a set Q of points is the smallest convex polygon P for which each point in Q is either on the boundary of P or in its interior. CS 312, Winter 2007 Project #1: Convex Hull Due Dates: See class schedule Overview: In this project, you will implement a divide and conquer algorithm for finding the convex hull of a set of points and

More information

Lecture 2 September 3

Lecture 2 September 3 EE 381V: Large Scale Optimization Fall 2012 Lecture 2 September 3 Lecturer: Caramanis & Sanghavi Scribe: Hongbo Si, Qiaoyang Ye 2.1 Overview of the last Lecture The focus of the last lecture was to give

More information

Preferred directions for resolving the non-uniqueness of Delaunay triangulations

Preferred directions for resolving the non-uniqueness of Delaunay triangulations Preferred directions for resolving the non-uniqueness of Delaunay triangulations Christopher Dyken and Michael S. Floater Abstract: This note proposes a simple rule to determine a unique triangulation

More information

Discrete Mathematics I So Practice Sheet Solutions 1

Discrete Mathematics I So Practice Sheet Solutions 1 Discrete Mathematics I So 2016 Tibor Szabó Shagnik Das Practice Sheet Solutions 1 Provided below are possible solutions to the questions from the practice sheet issued towards the end of the course. Exercise

More information

Mathematical and Algorithmic Foundations Linear Programming and Matchings

Mathematical and Algorithmic Foundations Linear Programming and Matchings Adavnced Algorithms Lectures Mathematical and Algorithmic Foundations Linear Programming and Matchings Paul G. Spirakis Department of Computer Science University of Patras and Liverpool Paul G. Spirakis

More information

Math 414 Lecture 2 Everyone have a laptop?

Math 414 Lecture 2 Everyone have a laptop? Math 44 Lecture 2 Everyone have a laptop? THEOREM. Let v,...,v k be k vectors in an n-dimensional space and A = [v ;...; v k ] v,..., v k independent v,..., v k span the space v,..., v k a basis v,...,

More information

Multiply using the grid method.

Multiply using the grid method. Multiply using the grid method. Learning Objective Read and plot coordinates in all quadrants DEFINITION Grid A pattern of horizontal and vertical lines, usually forming squares. DEFINITION Coordinate

More information

Lecture 3: Art Gallery Problems and Polygon Triangulation

Lecture 3: Art Gallery Problems and Polygon Triangulation EECS 396/496: Computational Geometry Fall 2017 Lecture 3: Art Gallery Problems and Polygon Triangulation Lecturer: Huck Bennett In this lecture, we study the problem of guarding an art gallery (specified

More information

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14 Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14 Scan Converting Lines, Circles and Ellipses Hello everybody, welcome again

More information

Integer Programming Theory

Integer Programming Theory Integer Programming Theory Laura Galli October 24, 2016 In the following we assume all functions are linear, hence we often drop the term linear. In discrete optimization, we seek to find a solution x

More information

CS675: Convex and Combinatorial Optimization Spring 2018 Consequences of the Ellipsoid Algorithm. Instructor: Shaddin Dughmi

CS675: Convex and Combinatorial Optimization Spring 2018 Consequences of the Ellipsoid Algorithm. Instructor: Shaddin Dughmi CS675: Convex and Combinatorial Optimization Spring 2018 Consequences of the Ellipsoid Algorithm Instructor: Shaddin Dughmi Outline 1 Recapping the Ellipsoid Method 2 Complexity of Convex Optimization

More information

Constructing a Cycle Basis for a Planar Graph

Constructing a Cycle Basis for a Planar Graph Constructing a Cycle Basis for a Planar Graph David Eberly, Geometric Tools, Redmond WA 98052 https://www.geometrictools.com/ This work is licensed under the Creative Commons Attribution 4.0 International

More information

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 24 Solid Modelling

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 24 Solid Modelling Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 24 Solid Modelling Welcome to the lectures on computer graphics. We have

More information

Computer Aided Engineering Design Prof. Anupam Saxena Department of Mechanical Engineering Indian Institute of Technology, Kanpur.

Computer Aided Engineering Design Prof. Anupam Saxena Department of Mechanical Engineering Indian Institute of Technology, Kanpur. (Refer Slide Time: 00:28) Computer Aided Engineering Design Prof. Anupam Saxena Department of Mechanical Engineering Indian Institute of Technology, Kanpur Lecture - 6 Hello, this is lecture number 6 of

More information

The Simplex Algorithm

The Simplex Algorithm The Simplex Algorithm Uri Feige November 2011 1 The simplex algorithm The simplex algorithm was designed by Danzig in 1947. This write-up presents the main ideas involved. It is a slight update (mostly

More information

Voronoi diagrams Delaunay Triangulations. Pierre Alliez Inria

Voronoi diagrams Delaunay Triangulations. Pierre Alliez Inria Voronoi diagrams Delaunay Triangulations Pierre Alliez Inria Voronoi Diagram Voronoi Diagram Voronoi Diagram The collection of the non-empty Voronoi regions and their faces, together with their incidence

More information

form are graphed in Cartesian coordinates, and are graphed in Cartesian coordinates.

form are graphed in Cartesian coordinates, and are graphed in Cartesian coordinates. Plot 3D Introduction Plot 3D graphs objects in three dimensions. It has five basic modes: 1. Cartesian mode, where surfaces defined by equations of the form are graphed in Cartesian coordinates, 2. cylindrical

More information

COMPUTING CONSTRAINED DELAUNAY

COMPUTING CONSTRAINED DELAUNAY COMPUTING CONSTRAINED DELAUNAY TRIANGULATIONS IN THE PLANE By Samuel Peterson, University of Minnesota Undergraduate The Goal The Problem The Algorithms The Implementation Applications Acknowledgments

More information

ECE 600, Dr. Farag, Summer 09

ECE 600, Dr. Farag, Summer 09 ECE 6 Summer29 Course Supplements. Lecture 4 Curves and Surfaces Aly A. Farag University of Louisville Acknowledgements: Help with these slides were provided by Shireen Elhabian A smile is a curve that

More information

Coverage and Search Algorithms. Chapter 10

Coverage and Search Algorithms. Chapter 10 Coverage and Search Algorithms Chapter 10 Objectives To investigate some simple algorithms for covering the area in an environment To understand how to break down an environment into simple convex pieces

More information

Line Arrangement. Chapter 6

Line Arrangement. Chapter 6 Line Arrangement Chapter 6 Line Arrangement Problem: Given a set L of n lines in the plane, compute their arrangement which is a planar subdivision. Line Arrangements Problem: Given a set L of n lines

More information

Topology and Boundary Representation. The ACIS boundary representation (B-rep) of a model is a hierarchical decomposition of the model s topology:

Topology and Boundary Representation. The ACIS boundary representation (B-rep) of a model is a hierarchical decomposition of the model s topology: Chapter 6. Model Topology Topology refers to the spatial relationships between the various entities in a model. Topology describes how geometric entities are connected (connectivity). On its own, topology

More information

If three points A (h, 0), P (a, b) and B (0, k) lie on a line, show that: a b 1.

If three points A (h, 0), P (a, b) and B (0, k) lie on a line, show that: a b 1. ASSIGNMENT ON STRAIGHT LINES LEVEL 1 (CBSE/NCERT/STATE BOARDS) 1 Find the angle between the lines joining the points (0, 0), (2, 3) and the points (2, 2), (3, 5). 2 What is the value of y so that the line

More information

CSE 5311 Notes 13: Computational Geometry

CSE 5311 Notes 13: Computational Geometry CSE 5311 Notes 13: Computational Geometry (Last updated 4/17/17 4:39 PM) SMALLEST ENCLOSING DISK See section 4.7 of de Berg ( http://dx.doi.org.ezproxy.uta.edu/10.1007/978-3-540-77974-2 ) Algorithm MINIDISC(P)

More information

Matching and Planarity

Matching and Planarity Matching and Planarity Po-Shen Loh June 010 1 Warm-up 1. (Bondy 1.5.9.) There are n points in the plane such that every pair of points has distance 1. Show that there are at most n (unordered) pairs of

More information

Definition: A data structure is a way of organizing data in a computer so that it can be used efficiently.

Definition: A data structure is a way of organizing data in a computer so that it can be used efficiently. The Science of Computing I Lesson 4: Introduction to Data Structures Living with Cyber Pillar: Data Structures The need for data structures The algorithms we design to solve problems rarely do so without

More information

EECS490: Digital Image Processing. Lecture #23

EECS490: Digital Image Processing. Lecture #23 Lecture #23 Motion segmentation & motion tracking Boundary tracking Chain codes Minimum perimeter polygons Signatures Motion Segmentation P k Accumulative Difference Image Positive ADI Negative ADI (ADI)

More information

1 Definition of Reduction

1 Definition of Reduction 1 Definition of Reduction Problem A is reducible, or more technically Turing reducible, to problem B, denoted A B if there a main program M to solve problem A that lacks only a procedure to solve problem

More information

2 Geometry Solutions

2 Geometry Solutions 2 Geometry Solutions jacques@ucsd.edu Here is give problems and solutions in increasing order of difficulty. 2.1 Easier problems Problem 1. What is the minimum number of hyperplanar slices to make a d-dimensional

More information

CMSC 754 Computational Geometry 1

CMSC 754 Computational Geometry 1 CMSC 754 Computational Geometry 1 David M. Mount Department of Computer Science University of Maryland Fall 2005 1 Copyright, David M. Mount, 2005, Dept. of Computer Science, University of Maryland, College

More information

The Three Dimensional Coordinate System

The Three Dimensional Coordinate System The Three-Dimensional Coordinate System The Three Dimensional Coordinate System You can construct a three-dimensional coordinate system by passing a z-axis perpendicular to both the x- and y-axes at the

More information

Answer Key: Three-Dimensional Cross Sections

Answer Key: Three-Dimensional Cross Sections Geometry A Unit Answer Key: Three-Dimensional Cross Sections Name Date Objectives In this lesson, you will: visualize three-dimensional objects from different perspectives be able to create a projection

More information

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs Advanced Operations Research Techniques IE316 Quiz 1 Review Dr. Ted Ralphs IE316 Quiz 1 Review 1 Reading for The Quiz Material covered in detail in lecture. 1.1, 1.4, 2.1-2.6, 3.1-3.3, 3.5 Background material

More information

Simplicial Complexes: Second Lecture

Simplicial Complexes: Second Lecture Simplicial Complexes: Second Lecture 4 Nov, 2010 1 Overview Today we have two main goals: Prove that every continuous map between triangulable spaces can be approximated by a simplicial map. To do this,

More information

Lecture 3 (CGAL) Panos Giannopoulos, Dror Atariah AG TI WS 2012/13

Lecture 3 (CGAL) Panos Giannopoulos, Dror Atariah AG TI WS 2012/13 Lecture 3 (CGAL) Panos Giannopoulos Dror Atariah AG TI WS 2012/13 Exercises? Outline Convex Hull in 3d Polyhedra and the Half Edge (or DCEL) data structure Exercise 3 3 stated above each λi is non-negative

More information

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize.

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize. Cornell University, Fall 2017 CS 6820: Algorithms Lecture notes on the simplex method September 2017 1 The Simplex Method We will present an algorithm to solve linear programs of the form maximize subject

More information

Tiling Three-Dimensional Space with Simplices. Shankar Krishnan AT&T Labs - Research

Tiling Three-Dimensional Space with Simplices. Shankar Krishnan AT&T Labs - Research Tiling Three-Dimensional Space with Simplices Shankar Krishnan AT&T Labs - Research What is a Tiling? Partition of an infinite space into pieces having a finite number of distinct shapes usually Euclidean

More information

Linear Programming Duality and Algorithms

Linear Programming Duality and Algorithms COMPSCI 330: Design and Analysis of Algorithms 4/5/2016 and 4/7/2016 Linear Programming Duality and Algorithms Lecturer: Debmalya Panigrahi Scribe: Tianqi Song 1 Overview In this lecture, we will cover

More information

On the number of distinct directions of planes determined by n points in R 3

On the number of distinct directions of planes determined by n points in R 3 On the number of distinct directions of planes determined by n points in R 3 Rom Pinchasi August 27, 2007 Abstract We show that any set of n points in R 3, that is not contained in a plane, determines

More information

Line segment intersection. Family of intersection problems

Line segment intersection. Family of intersection problems CG Lecture 2 Line segment intersection Intersecting two line segments Line sweep algorithm Convex polygon intersection Boolean operations on polygons Subdivision overlay algorithm 1 Family of intersection

More information

CSCI 4620/8626. Coordinate Reference Frames

CSCI 4620/8626. Coordinate Reference Frames CSCI 4620/8626 Computer Graphics Graphics Output Primitives Last update: 2014-02-03 Coordinate Reference Frames To describe a picture, the world-coordinate reference frame (2D or 3D) must be selected.

More information

CSCI 4620/8626. Computer Graphics Clipping Algorithms (Chapter 8-5 )

CSCI 4620/8626. Computer Graphics Clipping Algorithms (Chapter 8-5 ) CSCI 4620/8626 Computer Graphics Clipping Algorithms (Chapter 8-5 ) Last update: 2016-03-15 Clipping Algorithms A clipping algorithm is any procedure that eliminates those portions of a picture outside

More information

Clipping a Mesh Against a Plane

Clipping a Mesh Against a Plane Clipping a Mesh Against a Plane David Eberly, Geometric Tools, Redmond WA 98052 https://www.geometrictools.com/ This work is licensed under the Creative Commons Attribution 4.0 International License. To

More information

Geometry Vocabulary Math Fundamentals Reference Sheet Page 1

Geometry Vocabulary Math Fundamentals Reference Sheet Page 1 Math Fundamentals Reference Sheet Page 1 Acute Angle An angle whose measure is between 0 and 90 Acute Triangle A that has all acute Adjacent Alternate Interior Angle Two coplanar with a common vertex and

More information

CHAPTER - 10 STRAIGHT LINES Slope or gradient of a line is defined as m = tan, ( 90 ), where is angle which the line makes with positive direction of x-axis measured in anticlockwise direction, 0 < 180

More information

Practical Linear Algebra: A Geometry Toolbox

Practical Linear Algebra: A Geometry Toolbox Practical Linear Algebra: A Geometry Toolbox Third edition Chapter 18: Putting Lines Together: Polylines and Polygons Gerald Farin & Dianne Hansford CRC Press, Taylor & Francis Group, An A K Peters Book

More information

6.001 Notes: Section 8.1

6.001 Notes: Section 8.1 6.001 Notes: Section 8.1 Slide 8.1.1 In this lecture we are going to introduce a new data type, specifically to deal with symbols. This may sound a bit odd, but if you step back, you may realize that everything

More information

Geometry Vocabulary. acute angle-an angle measuring less than 90 degrees

Geometry Vocabulary. acute angle-an angle measuring less than 90 degrees Geometry Vocabulary acute angle-an angle measuring less than 90 degrees angle-the turn or bend between two intersecting lines, line segments, rays, or planes angle bisector-an angle bisector is a ray that

More information

Compression of Tetrahedral Meshes

Compression of Tetrahedral Meshes Compression of Tetrahedral Meshes Geometry Processing CS 7960 Louis Bavoil 01/19/2006 Outline Corner Table Edgebreaker Efficiency Edgebreaker with Boundary Corner Table Two arrays of integers: V and O

More information

POLYHEDRAL GEOMETRY. Convex functions and sets. Mathematical Programming Niels Lauritzen Recall that a subset C R n is convex if

POLYHEDRAL GEOMETRY. Convex functions and sets. Mathematical Programming Niels Lauritzen Recall that a subset C R n is convex if POLYHEDRAL GEOMETRY Mathematical Programming Niels Lauritzen 7.9.2007 Convex functions and sets Recall that a subset C R n is convex if {λx + (1 λ)y 0 λ 1} C for every x, y C and 0 λ 1. A function f :

More information

EXTERNAL VISIBILITY. 1. Definitions and notation. The boundary and interior of

EXTERNAL VISIBILITY. 1. Definitions and notation. The boundary and interior of PACIFIC JOURNAL OF MATHEMATICS Vol. 64, No. 2, 1976 EXTERNAL VISIBILITY EDWIN BUCHMAN AND F. A. VALENTINE It is possible to see any eleven vertices of an opaque solid regular icosahedron from some appropriate

More information

Euler's formula and Platonic solids

Euler's formula and Platonic solids University of Washington Euler's formula and Platonic solids Name: David Clark, Kelsey Kyllo, Kurt Maugerle, Yue Yuan Zhang Course Number: Math 445 Professor: Julia Pevtsova Date: 2013/06/03 Table of Contents:

More information

Topological Issues in Hexahedral Meshing

Topological Issues in Hexahedral Meshing Topological Issues in Hexahedral Meshing David Eppstein Univ. of California, Irvine Dept. of Information and Computer Science Outline I. What is meshing? Problem statement Types of mesh Quality issues

More information

Pacific Journal of Mathematics

Pacific Journal of Mathematics Pacific Journal of Mathematics SIMPLIFYING TRIANGULATIONS OF S 3 Aleksandar Mijatović Volume 208 No. 2 February 2003 PACIFIC JOURNAL OF MATHEMATICS Vol. 208, No. 2, 2003 SIMPLIFYING TRIANGULATIONS OF S

More information

We have set up our axioms to deal with the geometry of space but have not yet developed these ideas much. Let s redress that imbalance.

We have set up our axioms to deal with the geometry of space but have not yet developed these ideas much. Let s redress that imbalance. Solid geometry We have set up our axioms to deal with the geometry of space but have not yet developed these ideas much. Let s redress that imbalance. First, note that everything we have proven for the

More information

Let a line l and a point P not lying on it be given. By using properties of a transversal and parallel lines, a line which passes through the point P

Let a line l and a point P not lying on it be given. By using properties of a transversal and parallel lines, a line which passes through the point P Let a line l and a point P not lying on it be given. By using properties of a transversal and parallel lines, a line which passes through the point P and parallel to l, can be drawn. A triangle can be

More information

The statement implies that any three intersection points of two distinct planes lie on a line.

The statement implies that any three intersection points of two distinct planes lie on a line. Math 3181 Dr. Franz Rothe February 23, 2015 All3181\3181_spr15ts1.tex 1 Solution of Test Name: Problem 1.1. The second part of Hilbert s Proposition 1 states: Any two different planes have either no point

More information

Lecture 25 of 41. Spatial Sorting: Binary Space Partitioning Quadtrees & Octrees

Lecture 25 of 41. Spatial Sorting: Binary Space Partitioning Quadtrees & Octrees Spatial Sorting: Binary Space Partitioning Quadtrees & Octrees William H. Hsu Department of Computing and Information Sciences, KSU KSOL course pages: http://bit.ly/hgvxlh / http://bit.ly/evizre Public

More information

Introduction to Mathematical Programming IE406. Lecture 4. Dr. Ted Ralphs

Introduction to Mathematical Programming IE406. Lecture 4. Dr. Ted Ralphs Introduction to Mathematical Programming IE406 Lecture 4 Dr. Ted Ralphs IE406 Lecture 4 1 Reading for This Lecture Bertsimas 2.2-2.4 IE406 Lecture 4 2 The Two Crude Petroleum Example Revisited Recall the

More information

PRACTICAL GEOMETRY SYMMETRY AND VISUALISING SOLID SHAPES

PRACTICAL GEOMETRY SYMMETRY AND VISUALISING SOLID SHAPES UNIT 12 PRACTICAL GEOMETRY SYMMETRY AND VISUALISING SOLID SHAPES (A) Main Concepts and Results Let a line l and a point P not lying on it be given. By using properties of a transversal and parallel lines,

More information

Log1 Contest Round 2 Theta Circles, Parabolas and Polygons. 4 points each

Log1 Contest Round 2 Theta Circles, Parabolas and Polygons. 4 points each Name: Units do not have to be included. 016 017 Log1 Contest Round Theta Circles, Parabolas and Polygons 4 points each 1 Find the value of x given that 8 x 30 Find the area of a triangle given that it

More information

Graph Theory Questions from Past Papers

Graph Theory Questions from Past Papers Graph Theory Questions from Past Papers Bilkent University, Laurence Barker, 19 October 2017 Do not forget to justify your answers in terms which could be understood by people who know the background theory

More information

arxiv: v1 [math.co] 25 Sep 2015

arxiv: v1 [math.co] 25 Sep 2015 A BASIS FOR SLICING BIRKHOFF POLYTOPES TREVOR GLYNN arxiv:1509.07597v1 [math.co] 25 Sep 2015 Abstract. We present a change of basis that may allow more efficient calculation of the volumes of Birkhoff

More information

Math 5593 Linear Programming Lecture Notes

Math 5593 Linear Programming Lecture Notes Math 5593 Linear Programming Lecture Notes Unit II: Theory & Foundations (Convex Analysis) University of Colorado Denver, Fall 2013 Topics 1 Convex Sets 1 1.1 Basic Properties (Luenberger-Ye Appendix B.1).........................

More information

Lecture 25: Bezier Subdivision. And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10

Lecture 25: Bezier Subdivision. And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10 Lecture 25: Bezier Subdivision And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10 1. Divide and Conquer If we are going to build useful

More information

5 The Theory of the Simplex Method

5 The Theory of the Simplex Method 5 The Theory of the Simplex Method Chapter 4 introduced the basic mechanics of the simplex method. Now we shall delve a little more deeply into this algorithm by examining some of its underlying theory.

More information

HW Graph Theory Name (andrewid) - X. 1: Draw K 7 on a torus with no edge crossings.

HW Graph Theory Name (andrewid) - X. 1: Draw K 7 on a torus with no edge crossings. 1: Draw K 7 on a torus with no edge crossings. A quick calculation reveals that an embedding of K 7 on the torus is a -cell embedding. At that point, it is hard to go wrong if you start drawing C 3 faces,

More information

Computational Geometry: Lecture 5

Computational Geometry: Lecture 5 Computational Geometry: Lecture 5 Don Sheehy January 29, 2010 1 Degeneracy In many of the algorithms that we have discussed so far, we have run into problems when that input is somehow troublesome. For

More information

Technische Universität München Zentrum Mathematik

Technische Universität München Zentrum Mathematik Technische Universität München Zentrum Mathematik Prof. Dr. Dr. Jürgen Richter-Gebert, Bernhard Werner Projective Geometry SS 208 https://www-m0.ma.tum.de/bin/view/lehre/ss8/pgss8/webhome Solutions for

More information

COMPUTATIONAL GEOMETRY

COMPUTATIONAL GEOMETRY Thursday, September 20, 2007 (Ming C. Lin) Review on Computational Geometry & Collision Detection for Convex Polytopes COMPUTATIONAL GEOMETRY (Refer to O'Rourke's and Dutch textbook ) 1. Extreme Points

More information

Lecture 25 Spanning Trees

Lecture 25 Spanning Trees Lecture 25 Spanning Trees 15-122: Principles of Imperative Computation (Fall 2018) Frank Pfenning, Iliano Cervesato The following is a simple example of a connected, undirected graph with 5 vertices (A,

More information

CS3621 Midterm Solution (Fall 2005) 150 points

CS3621 Midterm Solution (Fall 2005) 150 points CS362 Midterm Solution Fall 25. Geometric Transformation CS362 Midterm Solution (Fall 25) 5 points (a) [5 points] Find the 2D transformation matrix for the reflection about the y-axis transformation (i.e.,

More information

The Game of Criss-Cross

The Game of Criss-Cross Chapter 5 The Game of Criss-Cross Euler Characteristic ( ) Overview. The regions on a map and the faces of a cube both illustrate a very natural sort of situation: they are each examples of regions that

More information

Chapter 15 Introduction to Linear Programming

Chapter 15 Introduction to Linear Programming Chapter 15 Introduction to Linear Programming An Introduction to Optimization Spring, 2015 Wei-Ta Chu 1 Brief History of Linear Programming The goal of linear programming is to determine the values of

More information