<p>Build <a href="https://en.wikipedia.org/wiki/Convex_hull" rel="nofollow noreferrer">convex hull</a> of all points.</p>

<p>Then find the largest area quadtrilateral with vertices belonging to the hull.
If hull count N is small, you can just check all diagonals. </p>

<p>Otherwise consider using of more advanced algorithms like this: <a href="https://arxiv.org/pdf/1708.00681.pdf" rel="nofollow noreferrer">Maximum-Area Quadrilateral in a Convex Polygon, Revisited</a></p>
Is there any fast formula to find the biggest area of a general quadrangle (hexahedron) given by N points?
<p>I am using pythom 3.6 and I have came across a problem. There are given n points by x and y coordinates (n is from 4 to 200) and I need to find the 4 points from those n which form the biggest general quadrangle (any convex shape formed by 4 points).</p>

<p>I can think of a solution including 4 for cycles with calculating the area of the quadrangle given by point in the for cycles, but it is extremaly slow. Do you know about anything faster?</p>

<p>The point are given like this:</p>

<pre><code>B = np.array([[ 1., 2.], [ 0., 0.], [ 1., 3.], [ -5., 6.], [ -6., 3.], [ 1., 5.], [ -1., 2.], [ 1., -3.], [ 4., 2.]])
</code></pre>

<p>The next level is when I get N points given by x, y and z coordinates (N is between 8 and 500) and I should find the biggest (in volume) hexahedron (the shape defined by 8 points) - I have no idea of the solution.</p>

<p>There is no need for right angles, just shapes defined by 4 (8) points. Any suggestions?</p>

<hr>

<p>Background:
I have quite complex 3D models of building which I need to simplify to one specific program for computations. The details on the building are not needed. All information about the buildings is in file.obj exported from Blender.</p>