<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE page SYSTEM "gen/gandraxa.dtd">
<?xml-stylesheet type="text/xsl" href="gen/gandraxa.xsl"?>
<!--
	To see this page properly, install a browser capable of
	interpreting XML/XSL, for example a recent version of:
	- Mozilla Firefox, see http://www.mozilla.com/
	- Google Chrome, see www.google.com/
	- Internet Explorer, see http://www.microsoft.com/
-->
<page>
	<head>
		<title>Draw Orthogonal Polygons</title>
		<url>http://herbert.gandraxa.com/draw_orthogonal_polygons.xml</url>
		<context>
			<path>
				<home>
					<link loc="int">
						<url>home.xml</url>
						<text>Home</text>
					</link>
				</home>
				<dir>
					<link loc="int">
						<url>articles.xml</url>
						<text>Articles</text>
					</link>
				</dir>
				<doc>Draw Orthogonal Polygons</doc>
			</path>
		</context>
		
		<author>
			<mail>
				<recipient>hg</recipient>
				<server>gandraxa.com</server>
				<name>Herbert Glarner</name>
			</mail>
		</author>
		
		<publ>
			<event>
				<eventdate><y>2007</y><m>Jan</m><d>16</d></eventdate>
				<eventtext>Original HTML version</eventtext>
			</event>
			<event>
				<eventdate><y>2011</y><m>Jan</m><d>31</d></eventdate>
				<eventtext>
					Recoded in XLM
				</eventtext>
			</event>
		</publ>
		
		<furtherreading>
			<readitem>
				<link loc="wiki">
					<url>http://en.wikipedia.org/wiki/Polygon</url>
					<text>Polygon</text>
				</link> on Wikipedia
			</readitem>
		</furtherreading>
	</head>

	<toc>
		<toc1 ref="A">Terms</toc1>
			<toc2 ref="A1">Canvas</toc2>
			<toc2 ref="A2">Polygon</toc2>
			
		<toc2 ref="B">Algorithm</toc2>
			<toc2 ref="B1">Preprocessing</toc2>
			<toc2 ref="B2">Processing</toc2>

		<toc1 ref="C">Example</toc1>
	</toc>

	<abstract>
		<p><ptitle>Abstract</ptitle>
			This article describes, how a simple orthogonal polygon 
			expressed as a list of vertex coordinates 
			can be efficiently drawn into a bounding rectangular area such, 
			that the interior of the polygon is given a distinct value unequal 0 
			and the exterior a value of 0 (or vice-versa).</p>
	</abstract>



	<part>
		<heading id="A">Terms</heading>
		<chapter>
			<heading id="A1">Canvas</heading>
			<body>
				<img float="left" width="102">
					<url>img/dop_fig1.gif</url>
					<alt>The Canvas</alt>
					<caption>Fig. 1. The used canvas.</caption>
				</img>
				<p>We define the needed terms by setting up an example, 
					which will accompany us through the whole rest of the article.</p>
				<p>Assume, that we are given a bounding rectangle 
					containing an arbitrary 12 x 12 cells (e.g. pixels on a screen), 
					into which information bounded by a polygonal shape shall be drawn.</p>
				<p>The abscissa (x axis) of the bounding rectangle runs from 
					the left to the right as usual in 
					<link loc="wiki">
						<url>http://en.wikipedia.org/wiki/Cartesian_coordinate_system</url>
						<text>Cartesian coordinate systems</text>
					</link>, 
					but the ordinate (y axis) runs from the top to the bottom 
					(rather than the usual bottom up) 
					to better reflect typical computer screens.</p>
				<p>Because we will need to clearly distinguish between upper and lower, 
					and left and right, resp., it is advantageous to enumerate 
					the vertical and horizontal lines in between the cells 
					(represented by the white squares in fig. 1), 
					not the squares themselves in between two such line pairs. 
					Hence there are 13 lines on each axis and they
					are enumerated from 0 to 12 as follows.</p>
				<p>For the rest of the article is valid, 
					that white squares represent the value unequal 0, 
					indicating that such are part of the polygon. 
					Accordingly, black squares shall signify 0 
					and thus "not part of the polygon".</p>
			</body>
		</chapter>
		<chapter>
			<heading id="A2">Polygon</heading>
			<body>
				<p>Now assume, that we are given a simple orthogonal 
					<link loc="wiki">
						<url>http://en.wikipedia.org/wiki/Icosagon</url>
						<text>icosagon</text>
					</link> with a list of vertices, 
					given in "screen" coordinates as defined above.</p>
				<p>Because we need to know, which side needs to be treated 
					as the inside of the polygon (and accordingly which one as its outside), 
					we must define a direction in which we want to traverse 
					the polygon's vertices.</p>
				<p>Arbitrarily, we define to list the vertices in a clockwise direction, 
					with the implication, that the interior of the polygon 
					lies on the right side of the edges as we travel around the polygon.</p>
				<p>This is the list with the vertex coordinates for our example:</p>				

			    <table>
			        <row>
			            <col>Vertex</col>
			            <col>Vertex 1</col>
			
			            <col>Vertex 2</col>
			            <col>Vertex 3</col>
			            <col>Vertex 4</col>
			            <col>Vertex 5</col>
			            <col>Vertex 6</col>
			            <col>Vertex 7</col>
			
			            <col>Vertex 8</col>
			            <col>Vertex 9</col>
			            <col>Vertex 10</col>
			        </row>
			        <row>
			            <col>Coordinates</col>
			
			            <col>4/1</col>
			
			            <col>8/1</col>
			            <col>8/4</col>
			            <col>7/4</col>
			            <col>7/6</col>
			            <col>8/6</col>
			
			            <col>8/5</col>
			
			            <col>11/5</col>
			            <col>11/9</col>
			            <col>8/9</col>
			        </row>
			        <row>
			
			            <col>Vertex</col>
			            <col>Vertex 11</col>
			
			            <col>Vertex 12</col>
			            <col>Vertex 13</col>
			            <col>Vertex 14</col>
			            <col>Vertex 15</col>
			
			            <col>Vertex 16</col>
			            <col>Vertex 17</col>
			
			            <col>Vertex 18</col>
			            <col>Vertex 19</col>
			            <col>Vertex 20</col>
			        </row>
			
			        <row>
			            <col>Coordinates</col>
			            <col>8/11</col>
			
			            <col>5/11</col>
			            <col>5/10</col>
			            <col>2/10</col>
			
			            <col>2/7</col>
			            <col>3/7</col>
			            <col>3/5</col>
			
			            <col>1/5</col>
			            <col>1/2</col>
			            <col>4/2</col>
			
			        </row>
			    </table>
				<p>Coordinates are given in x/y notation. 
					[Thanks go to Brian Lewis for spotting a typo.]</p>

				<img float="left" width="102">
					<url>img/dop_fig2.gif</url>
					<alt>What we want to achieve</alt>
					<caption>Fig. 2. What we want to achieve.</caption>
				</img>
				<p>As per agreement we want to render the polygon's interior in white 
					(signifying the non zero value) and its outside in black (the zero value). 
					Therefore our polygon eventually must look like in fig. 2.</p>
    			<p>The intent of this article is to show, 
    				how this result can be obtained by processing each vertex just once, 
    				without the need to compare opposite bounds in a time-consuming way.</p>
    			<floatclear/>
			</body>
		</chapter>

	</part>

	<part>
		<heading id="B">Algorithm</heading>
		<chapter>
			<heading id="B1">Preprocessing</heading>
			<body>
				<p>The presented algorithm will set the subareas 
					(pixels, flags, in the examples rendered as squares) 
					of the outside area of the polygon to 0, 
					leaving the interior as it was before.</p>
				<p>This implies, that an initial preprocessing task must be performed 
					in order to obtain a completely "painted" canvas 
					in the dimensions of the bounding rectangle, 
					i.e. the whole bounding rectangle must initially be set 
					with the non zero value. Compare with fig. 1: the canvas is white, 
					which is the "interior" color.</p>
				<p>Omitting this preprocessing step will result in the complement of the 
					desired result, i.e. white and black areas are reversed 
					(which can be useful, too, depending on your application).</p>
			</body>
		</chapter>
		<chapter>
			<heading id="B2">Processing</heading>
			<body>
				<p>For each vertex, we consider the edge pair consisting of the edge 
					which leads to it <em>(approaching edge)</em> and the one moving away from it 
					<em>(receding edge)</em>. (This means, that although we process 
					only the 20 given vertices, ultimately we need to consider 20 
					adjacent edge <em>pairs</em> and thus a total of 21 edges: 
					the first vertex' approaching edge also is the last vertex' receding edge.)</p>
				<p>Assuming, that coordinates are only given at points 
					at which the direction changes (there is no reason to mark 
					a vertex anywhere else along an edge), the two edges at the vertex 
					can only form an angle of either 90° or then of 270° 
					(else it would not be an orthogonal one). 
					This has the notion of a <em>corner</em>, 
					which term we will use from now on whenever we mean 
					"two consecutive edges meeting at a vertex".
					 There are as many corners as there are vertices: 
					 in our example there are 20.</p>
				<p>What we primarily are interested in, 
					is the direction of each of the corners. 
					Let's have a look at the first corner.</p>
				<p>First corner? This requires some elaboration. 
					Which one is the first corner, the one consisiting of the first vertex? 
					Well, it does not matter, which corner we declare to be the first, 
					as long as we process them all. 
					However, in an actual implementation it turns out 
					to be advantageous if we declare the corner around 
					the second vertex to be the first corner. 
					This is because we need to find the direction of the approaching edge, 
					which for the corner including the first vertex originates 
					at the last vertex of the polygon. 
					This last vertex usually still is out of scope, 
					and depending on implementation, possibly will not be known 
					before having processed the whole vertex list. 
					This is not the case for the second vertex, though: 
					for it, the approaching edge originates at the very first vertex, 
					which is known right from the beginning.</p>
				<img float="left" width="102">
					<url>img/dop_fig3.gif</url>
					<alt>RD corner</alt>
					<caption>Fig. 3. RD corner.</caption>
				</img>
				<p>Throughout all following examples,
					 we will mark corners by coloring the two involved edges red. 
					 Note, that an arrowhead at the end of the receding edge 
					 marks the direction in which we travel (clockwise, as defined above). 
					 For the first corner, see fig. 3, we speak of a "right/down"-corner 
					 (or <code>RD</code> corner for short), because 
					 the approaching (first) edge goes to the right and 
					 the receding (second) edge goes downwards.</p>
				<p>How many distinctive corners are there? Well, 
					the approaching edge can point to any of the 4 possible directions 
					left, right, top and down, and so can the receding edge.</p>
				<p>However, because a corner has an angle of either 90° or 270°, 
					not all 4 x 4 combinations are possible: in fact, 
					only 8 combinations exist, because for either one of 
					the 4 possible approaching edges, only 2 "continuations" are possible 
					(the other two possibilities would mean "continue into the same direction", 
					and "go back into the direction where we came from", 
					both resulting in a degenerated corner, i.e. a straight line,
					or no movement at all).</p>
				<p>It should come as no surprise, 
					that our icosagon contains corners in all possible combinations. 
					The following table shows a specimen of each. 
					The two-letters-abbreviation above the figure identify 
					the directions of the two edges 
					(where <code>R</code>, <code>L</code>, <code>D</code> and <code>U</code>
					stand for Right, Left, Down, and Up, resp.)</p>
				<p>Note, that if we just looked at the directed edges, 
					we can distinguish 4 clockwise corners and 4 counterclockwise corners: 
					although they involve the same edges and meet at the same vertex location, 
					their direction is different and consequently they are named differently.</p>
				<table>
					<row>
						<col></col>
						<col><code>RD</code> corner</col>
						<col><code>DL</code> corner</col>
						<col><code>LU</code> corner</col>
						<col><code>UR</code> corner</col>
					</row>
					<row>
						<col>Clockwise corners</col>
						<col>
							<img float="left" width="102">
								<url>img/dop_fig4a.gif</url>
								<alt>RD corner</alt>
							</img>
						</col>
						<col>
							<img float="left" width="102">
								<url>img/dop_fig4b.gif</url>
								<alt>DL corner</alt>
							</img>
						</col>
						<col>
							<img float="left" width="102">
								<url>img/dop_fig4c.gif</url>
								<alt>LU corner</alt>
							</img>
						</col>
						<col>
							<img float="left" width="102">
								<url>img/dop_fig4d.gif</url>
								<alt>UR corner</alt>
							</img>
						</col>
					</row>
					<row>
						<col></col>
						<col><code>UL</code> corner</col>
						<col><code>RU</code> corner</col>
						<col><code>DR</code> corner</col>
						<col><code>LD</code> corner</col>
					</row>
					<row>
						<col>Corresponding conterclockwise corners</col>
						<col>
							<img float="left" width="102">
								<url>img/dop_fig4e.gif</url>
								<alt>UL corner</alt>
							</img>
						</col>
						<col>
							<img float="left" width="102">
								<url>img/dop_fig4f.gif</url>
								<alt>RU corner</alt>
							</img>
						</col>
						<col>
							<img float="left" width="102">
								<url>img/dop_fig4g.gif</url>
								<alt>DR corner</alt>
							</img>
						</col>
						<col>
							<img float="left" width="102">
								<url>img/dop_fig4h.gif</url>
								<alt>LD corner</alt>
							</img>
						</col>
					</row>
					<caption>Fig. 4. All possible corners</caption>
				</table>
				<p>Corners being positionally identical with the exception of the direction 
					belong to a different set and therefore also must be treated differently. 
					Therefore it is surprising, that the same is not the case 
					for corner pairs which involve the same directional edges 
					(because they indeed look different). 
					Despite the apparent difference, 
					it is irrelevant in what order the edges appear 
					(i.e. if a particular edge is approaching or receding): 
					For example is a <code>DR</code> corner treated absolutely like 
					an <code>RD</code> corner when processed.</p>
				<p>Therefore, we in fact only have to consider 4 distinct corner types, 
					identifiable by the corner's constituting edges. 
					Just mark, say in a bitfield, which two edges belong to the corner, 
					and mark them as to the left, to the right, upwards or downwards. 
					Thus, 4 bits suffice to tell which 2 of the 4 possible edges are involved.</p>
				<p>Notice, that in fact two bits would be enough, 
					because either a left or a right edge must be present, 
					as well as must either an upward or downward edge. 
					Such, we could define <em>horizontal</em> 
					instead of to the left and to the right,
					and accordingly <em>vertical</em> instead of upward or downward. 
					Then we only would need to define, what 0 and 1 mean, 
					and could go along with just two bits. 
					However, for the sake of simplicity we will continue 
					to use the more explicit 4 values without 
					the burden of an imposed definition.</p>
				<multiimg orientation="vertical" float="left" width="80">
					<img>
						<url>img/dop_fig5.gif</url>
						<alt>One bit per edge</alt>
						<caption>Fig. 5. One bit per edge</caption>
					</img>
					<img>
						<url>img/dop_fig6.gif</url>
						<alt>Greyed out positions</alt>
						<caption>Fig. 6. Greyed out positions</caption>
					</img>
				</multiimg>
				<p>To easily point out involved edges, let's assume, 
					those 4 bits are in a dedicated position within a word. 
					Somewhat arbitrarily we define that order to be 
					<code>L</code>, <code>R</code>, <code>U</code> and <code>F</code> 
					from the most significant to the least significant bit, as shown in fig.5.</p>
				<p>Whenever we refer to a corner, the two not appearing edges 
					will be greyed out, see fig. 6 for an example.</p>
				<p>Recall, that it does not matter which edge appears first.
					Fig. 6 can mean "first to the left, then downward", 
						but also "first downward, then to the left".</p>
				<p>These are some examples of the 4 possible groups:</p>
			    <table>
			
			        <row>
			            <col>Present edges</col>
			            <col>Clockwise</col>
			            <col>Counterclockwise</col>
			        </row>
			        <row>
			            <col><img><url>img/dop_fig7ld.gif</url><alt>LD corner</alt></img></col>
			
			            <col><img><url>img/dop_fig7a.gif</url><alt>LD corner clockwise</alt></img></col>
			            <col><img><url>img/dop_fig7b.gif</url><alt>LD corner counterclockwise</alt></img></col>
			        </row>
			        <row>
			            <col><img><url>img/dop_fig7rd.gif</url><alt>RD corner</alt></img></col>
			            <col><img><url>img/dop_fig7c.gif</url><alt>RD corner clockwise</alt></img></col>
			            <col><img><url>img/dop_fig7d.gif</url><alt>RD corner counterclockwise</alt></img></col>
			        </row>
			        <row>
			
			            <col><img><url>img/dop_fig7lu.gif</url><alt>LU corner</alt></img></col>
			            <col><img><url>img/dop_fig7e.gif</url><alt>LU corner clockwise</alt></img></col>
			            <col><img><url>img/dop_fig7f.gif</url><alt>LU corner counterclockwise</alt></img></col>
			        </row>
			        <row>
			            <col><img><url>img/dop_fig7ru.gif</url><alt>RU corner</alt></img></col>
			            <col><img><url>img/dop_fig7g.gif</url><alt>RU corner clockwise</alt></img></col>
			            <col><img><url>img/dop_fig7h.gif</url><alt>RU corner counterclockwise</alt></img></col>
			        </row>
					<caption>Fig. 7. The 4 corner groups.</caption>
			    </table>
				<p>Once we have determined, which of the 4 cases is applicable 
					for the corner actually being processed, 
					we proceed by identifying the four quadrants 
					within the bounding rectangle.</p>
				<p>The <em>quadrants</em> are defined by extending the two involved edges, 
					in such a way, that the involved vertex at the given coordinate 
					separates the whole surrounding rectangle into 2 x 2 halves.</p>

				<p>As an example on how to identify the 4 quadrants, 
					consider the 6th corner with the coordinates 8/5 in fig. 8.</p>
				<multiimg orientation="horizontal" float="left" width="400">
	            	<img>
	            		<url>img/dop_fig8a.gif</url>
	            		<alt>A corner for which to identify quadrants</alt>
	            		<caption>Fig. 8a. An UR corner.</caption>
	            	</img>
	            	<img>
	            		<url>img/dop_fig8b.gif</url>
	            		<alt>Identifying a corner's quandrants</alt>
	            		<caption>Fig. 8b. Quadrants for this 
	            			particular corner.</caption>
	            	</img>
		            <img float="left" width="102">
		           		<url>img/dop_fig9.gif</url>
		           		<alt>Choosing the correct quadrant</alt>
		           		<caption>Fig. 9. Finding the quadrant.</caption>
		           	</img>
				</multiimg>

			       
				<p>One of these quadrants is now manipulated by 
					<link loc="wiki">
						<url>http://en.wikipedia.org/wiki/Exclusive_or</url>
						<text>XORing</text>
					</link> it: this means, 
					if a subarea (pixel) currently has the value 0 
					(represented by a black square), 
					it is replaced with our non zero value 
					(represented by a white square); 
					but if it already has that non zero value, 
					then it is replaced with a 0.</p>
				<p>Remains only to set out the rule, which quadrant needs to be treated that way. 
					Here it is:</p>
				<p>The manipulated quadrant is in that half, 
					which is opposite to the receding edge. 
					Of the two quadrants in that half, 
					choose the one which is adjacent to the approaching edge.</p>

				<p>For our example with the 6th corner this works out so: 
					the receding edge points to the right, 
					thus the quadrant in question must be to the left; 
					and because the approaching edge is in the lower half, 
					our candidate must be the lower left quadrant (fig. 9).</p>
    			<p>Notice, how the involved (directed) edges just need to be 
    				<link loc="wiki">
    					<url>http://en.wikipedia.org/wiki/Negation</url>
    					<text>negated</text>
    				</link> in order to obtain the correct quadrant 
    				<em>directly</em> (fig. 10).</p>
			    <table>
			        <row>
			            <col>Involved edges</col>
					    <col><img><url>img/dop_fig7ld.gif</url><alt>LD corner</alt></img></col>
			
					    <col><img><url>img/dop_fig7rd.gif</url><alt>RD corner</alt></img></col>
					    <col><img><url>img/dop_fig7lu.gif</url><alt>LU corner</alt></img></col>
					    <col><img><url>img/dop_fig7ru.gif</url><alt>RU corner</alt></img></col>
			        </row>
			        <row>
			            <col>Affected quadrant after negation</col>
					    <col><img><url>img/dop_fig7ru.gif</url><alt>RU corner</alt></img></col>
					    <col><img><url>img/dop_fig7lu.gif</url><alt>LU corner</alt></img></col>
			
					    <col><img><url>img/dop_fig7rd.gif</url><alt>RD corner</alt></img></col>
					    <col><img><url>img/dop_fig7ld.gif</url><alt>LD corner</alt></img></col>
			        </row>
			        <row>
			            <col>Read result as:</col>
			            <col>Upper right</col>
			            <col>Upper left</col>
			
			            <col>Lower right</col>
			            <col>Lower left</col>
			        </row>
			        <caption>Fig. 10. Negating quadrants.</caption>
			    </table>
				<p>Notabene, that the black squares in fig. 9 
					(and in the following quadrant figures) does not imply, 
					that all subareas within the bounding rectangle are converted from 1 to 0. 
					It rather means, that the <em>actual content</em> 
					of each affected subarea (black square) is <code>XOR</code>ed 
					with our non zero value, writing back the result of the operation 
					as the subarea's new content. Such, depending on what was present 
					before the operation, each individual subarea within the quadrant 
					is "set" or "cleared" individually.</p>
				<p>Well, that's all what there is about it. 
					Applying this technique for each corner leaves us with the desired result. 
					This is shown in the next section, step by step for all 20 corners.</p>
			</body>
		</chapter>

	</part>


	<part>
		<heading id="C">Example</heading>
		<body>

		    <table>
		        <row>
		            <col>Step</col>
		
		            <col>Involved Corner</col>
		            <col>Flags</col>
		            <col><code>XOR</code> Quadrant</col>
		            <col>Result</col>
		        </row>
		        <row>
		            <col>Preprocessing</col>
		
		            <col></col>
		            <col></col>
		            <col></col>
		            <col><img><url>img/dop_fig11_0c.gif</url><alt>Preprocessing result</alt></img></col>
		        </row>
		        <row>
		            <col>Corner 1</col>
		            <col><img><url>img/dop_fig11_1a.gif</url><alt>Corner 1 Involved corner</alt></img></col>
		
				    <col><img><url>img/dop_fig7rd.gif</url><alt>RD corner</alt></img></col>
		            <col><img><url>img/dop_fig11_1b.gif</url><alt>Corner 1 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_1c.gif</url><alt>Corner 1 Result</alt></img></col>
		        </row>
		        <row>
		            <col>Corner 2</col>
		            <col><img><url>img/dop_fig11_2a.gif</url><alt>Corner 2 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7ld.gif</url><alt>LD corner</alt></img></col>
		
		            <col><img><url>img/dop_fig11_2b.gif</url><alt>Corner 2 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_2c.gif</url><alt>Corner 2 Result</alt></img></col>
		        </row>
		        <row>
		            <col>Corner 3</col>
		            <col><img><url>img/dop_fig11_3a.gif</url><alt>Corner 3 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7ld.gif</url><alt>LD corner</alt></img></col>
		            <col><img><url>img/dop_fig11_3b.gif</url><alt>Corner 3 XOR Quadrant</alt></img></col>
		
		            <col><img><url>img/dop_fig11_3c.gif</url><alt>Corner 3 Result</alt></img></col>
		        </row>
		        <row>
		            <col>Corner 4</col>
		            <col><img><url>img/dop_fig11_4a.gif</url><alt>Corner 4 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7rd.gif</url><alt>RD corner</alt></img></col>
		            <col><img><url>img/dop_fig11_4b.gif</url><alt>Corner 4 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_4c.gif</url><alt>Corner 4 Result</alt></img></col>
		
		        </row>
		        <row>
		            <col>Corner 5</col>
		            <col><img><url>img/dop_fig11_5a.gif</url><alt>Corner 5 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7ru.gif</url><alt>RU corner</alt></img></col>
		            <col><img><url>img/dop_fig11_5b.gif</url><alt>Corner 5 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_5c.gif</url><alt>Corner 5 Result</alt></img></col>
		        </row>
		
		        <row>
		            <col>Corner 6</col>
		            <col><img><url>img/dop_fig11_6a.gif</url><alt>Corner 6 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7ru.gif</url><alt>RU corner</alt></img></col>
		            <col><img><url>img/dop_fig11_6b.gif</url><alt>Corner 6 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_6c.gif</url><alt>Corner 6 Result</alt></img></col>
		        </row>
		        <row>
		
		            <col>Corner 7</col>
		            <col><img><url>img/dop_fig11_7a.gif</url><alt>Corner 7 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7rd.gif</url><alt>RD corner</alt></img></col>
		            <col><img><url>img/dop_fig11_7b.gif</url><alt>Corner 7 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_7c.gif</url><alt>Corner 7 Result</alt></img></col>
		        </row>
		        <row>
		            <col>Corner 8</col>
		
		            <col><img><url>img/dop_fig11_8a.gif</url><alt>Corner 8 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7ld.gif</url><alt>LD corner</alt></img></col>
		            <col><img><url>img/dop_fig11_8b.gif</url><alt>Corner 8 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_8c.gif</url><alt>Corner 8 Result</alt></img></col>
		        </row>
		        <row>
		            <col>Corner 9</col>
		            <col><img><url>img/dop_fig11_9a.gif</url><alt>Corner 9 Involved corner</alt></img></col>
		
				    <col><img><url>img/dop_fig7ld.gif</url><alt>LD corner</alt></img></col>
		            <col><img><url>img/dop_fig11_9b.gif</url><alt>Corner 9 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_9c.gif</url><alt>Corner 9 Result</alt></img></col>
		        </row>
		        <row>
		            <col>Corner 10</col>
		            <col><img><url>img/dop_fig11_10a.gif</url><alt>Corner 10 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7ld.gif</url><alt>LD corner</alt></img></col>
		
		            <col><img><url>img/dop_fig11_10b.gif</url><alt>Corner 10 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_10c.gif</url><alt>Corner 10 Result</alt></img></col>
		        </row>
		        <row>
		            <col>Corner 11</col>
		            <col><img><url>img/dop_fig11_11a.gif</url><alt>Corner 11 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7lu.gif</url><alt>LU corner</alt></img></col>
		            <col><img><url>img/dop_fig11_11b.gif</url><alt>Corner 11 XOR Quadrant</alt></img></col>
		
		            <col><img><url>img/dop_fig11_11c.gif</url><alt>Corner 11 Result</alt></img></col>
		        </row>
		        <row>
		            <col>Corner 12</col>
		            <col><img><url>img/dop_fig11_12a.gif</url><alt>Corner 12 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7lu.gif</url><alt>LU corner</alt></img></col>
		            <col><img><url>img/dop_fig11_12b.gif</url><alt>Corner 12 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_12c.gif</url><alt>Corner 12 Result</alt></img></col>
		
		        </row>
		        <row>
		            <col>Corner 13</col>
		            <col><img><url>img/dop_fig11_13a.gif</url><alt>Corner 13 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7lu.gif</url><alt>LU corner</alt></img></col>
		            <col><img><url>img/dop_fig11_13b.gif</url><alt>Corner 13 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_13c.gif</url><alt>Corner 13 Result</alt></img></col>
		        </row>
		
		        <row>
		            <col>Corner 14</col>
		            <col><img><url>img/dop_fig11_14a.gif</url><alt>Corner 14 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7ru.gif</url><alt>RU corner</alt></img></col>
		            <col><img><url>img/dop_fig11_14b.gif</url><alt>Corner 14 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_14c.gif</url><alt>Corner 14 Result</alt></img></col>
		        </row>
		        <row>
		
		            <col>Corner 15</col>
		            <col><img><url>img/dop_fig11_15a.gif</url><alt>Corner 15 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7ru.gif</url><alt>RU corner</alt></img></col>
		            <col><img><url>img/dop_fig11_15b.gif</url><alt>Corner 15 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_15c.gif</url><alt>Corner 15 Result</alt></img></col>
		        </row>
		        <row>
		            <col>Corner 16</col>
		
		            <col><img><url>img/dop_fig11_16a.gif</url><alt>Corner 16 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7lu.gif</url><alt>LU corner</alt></img></col>
		            <col><img><url>img/dop_fig11_16b.gif</url><alt>Corner 16 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_16c.gif</url><alt>Corner 16 Result</alt></img></col>
		        </row>
		        <row>
		            <col>Corner 17</col>
		            <col><img><url>img/dop_fig11_17a.gif</url><alt>Corner 17 Involved corner</alt></img></col>
		
				    <col><img><url>img/dop_fig7lu.gif</url><alt>LU corner</alt></img></col>
		            <col><img><url>img/dop_fig11_17b.gif</url><alt>Corner 17 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_17c.gif</url><alt>Corner 17 Result</alt></img></col>
		        </row>
		        <row>
		            <col>Corner 18</col>
		            <col><img><url>img/dop_fig11_18a.gif</url><alt>Corner 18 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7ru.gif</url><alt>RU corner</alt></img></col>
		
		            <col><img><url>img/dop_fig11_18b.gif</url><alt>Corner 18 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_18c.gif</url><alt>Corner 18 Result</alt></img></col>
		        </row>
		        <row>
		            <col>Corner 19</col>
		            <col><img><url>img/dop_fig11_19a.gif</url><alt>Corner 19 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7ru.gif</url><alt>RU corner</alt></img></col>
		            <col><img><url>img/dop_fig11_19b.gif</url><alt>Corner 19 XOR Quadrant</alt></img></col>
		
		            <col><img><url>img/dop_fig11_19c.gif</url><alt>Corner 19 Result</alt></img></col>
		        </row>
		        <row>
		            <col>Corner 20</col>
		            <col><img><url>img/dop_fig11_20a.gif</url><alt>Corner 20 Involved corner</alt></img></col>
				    <col><img><url>img/dop_fig7ru.gif</url><alt>RU corner</alt></img></col>
		            <col><img><url>img/dop_fig11_20b.gif</url><alt>Corner 20 XOR Quadrant</alt></img></col>
		            <col><img><url>img/dop_fig11_20c.gif</url><alt>Corner 20 Result</alt></img></col>
		
		        </row>
		        <caption>Fig. 11. Step-by-step simulation for the example polygon.</caption>
		    </table>

			<p>After having processed the last corner,
				we are left with the desired representation as initially defined in fig. 2.</p>		
		    
		</body>

	</part>

</page>






