title: How to design shape class
body: <p>I want to design shape class. I need to distinguish several different shapes:  </p>
  
  <pre><code>-Point  
  -Line  
  -Triangle  
  -Circle  
  -Polygons  
  </code></pre>
  
  <p>The main purpose of this class is to calculate distance between two shapes.<br>
  I've all methods for calculating those distances, but I want to have a single method that can be used, it should looks like this:</p>
  
  <pre><code>float Distance(Shape a, Shape b)
  </code></pre>
  
  <p>Simplest way to do it is to put a lot of if statements and then invoke proper method but this is deffinitely not OOP.</p>
  
  <p>How to design such class in OOP style?</p>