title: Calculate the distance of the shortest path around outside of 3D box
body: <p>I need some help with the math behind an assignment i was given. The problem was to calculate the distance from the ant to the candy. The candy is always on top of the box and the ant can be anywhere but the sides. The ant can craw on the top and the sides but CANNOT fly. They give you the coordinates of the ant and the candy as 6 numbers in a row. The first 3 are the ant's the next 3 are the candy's. The problem i am having is on the 3rd sample input (0 0 0 5 4 3.0). How do they get 8.60 units as the answer? When the distance up is 3 and the distance to the corner is 6.40 so the total should be 9.40. My guess is they cut the corner while going up but im not sure how to make a formula for the to find the shortest length like that. Thanks for your help :D if you need more information just ask.</p>
  
  <p>The box is (5,4,3) in x,z,y format.</p>
  
  <pre><code>Sample Input:                       
  3 1 3 3 3 3            
  2.25 0 2 2.5 2 3          
  0 0 0 5 4 3.0   
  0 4 3 5 0.0 3        
  5 0 3 5 4.00 3           
  
  Sample Output:               
  Shortest distance = 2.00 units            
  Shortest distance = 3.01 units        
  Shortest distance = 8.60 units             
  Shortest distance = 6.40 units            
  Shortest distance = 4.00 units
  </code></pre>