title: oriented minimum bounding box
body: <p>I'm looking for a java code to create a oriented minimum bounding box with points, which have a lat/lon value.  I've already created a minimum bounding box, like this: </p>
  
  <pre><code>public Mbb boundingBox() {
      Point ll, ur; 
      Mbb bBox;
      int id =1;
      ll = new Point(id, Double.MAX_VALUE, Double.MAX_VALUE); 
      ur= new Point(id,-1*Double.MAX_VALUE, -1*Double.MAX_VALUE);
  
      if (this.pg.size() &lt;=1)   
          return null;
  
      double minLat = Double.MAX_VALUE;
      double minLong = Double.MAX_VALUE;
      double maxLat = Double.MAX_VALUE*-1;
      double maxLong = Double.MAX_VALUE*-1;
  
      for (Point testPoint: this.pg) {
          double lat = testPoint.getLat();
          double lon = testPoint.getLon();
  
          if(minLat&gt;lat)
              minLat=lat;
          if(minLong&gt;lon)
              minLong=lon;
          if(maxLat&lt;lat)
              maxLat=lat;
          if(maxLong&lt;lon)
              maxLong=lon;
      }
  
      ll.setLat(minLat);
      ll.setLon(minLong);
      ur.setLat(maxLat);
      ur.setLon(maxLong);
  
      bBox= new Mbb(id, ll, ur); 
      return bBox;
  }
  </code></pre>
  
  <p>But this is not an oriented one. Has anybody an idea how to orient my bounding box?</p>