title: Calculating the boundary of irregular shape in Cartesian Coordinate 2D
body: <p>I'm looking for a solution to calculate the boundary of an irregular shape.</p>
  
  <p>Lats take a look at Square example:
  <a href="https://i.stack.imgur.com/4hi5J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4hi5J.png" alt="Simple Square"></a></p>
  
  <p>if i have <strong>Minimum</strong> <code>x</code> and <code>y</code> and <strong>Maximum</strong> <code>x</code> and <code>y</code> like:</p>
  
  <pre><code>MaxX = 5
  MinX = 1
  MaxY = 5
  MinY = 1
  </code></pre>
  
  <p>in python language:</p>
  
  <pre><code>#Python Code
  X = {"Min":1, "Max":5} # is Dictionary of x Axis
  Y = {"Min":1, "Max":5} # is Dictionary of y Axis
  </code></pre>
  
  <p>I can check if any coordinate is in the square boundary or not, simpley by comparing the axis against min and max of square boundary. </p>
  
  <p>now let's look at these 2 irregular example:
  <a href="https://i.stack.imgur.com/Mr3fq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mr3fq.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/EAfAa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EAfAa.png" alt="enter image description here"></a></p>
  
  <p>Now how can i calculate the boundary and coordinates of the shape? i do have the point coordinate but i don't have the coordinates inside the shape and lines coordinate that connecting every points of the shape.</p>
  
  <p><strong>Note:</strong> you might suggest for Point-in-Polygon but that's like calculating every time for specific coordinate, and if shape is huge it will take time.</p>
  
  <p><strong>Note:</strong> even if you heard of a solution in any book, speech, video, website, or even you are guessing, please do let me know in the comment, that could help me out.</p>