Detect Location of known Points in a Rectangle
<p>I have a array of 4 <code>PointF</code> objects. Each point in this array is a Corner of a rectangle. Now I want to set the Points in that array in a certain order in dependence of their Location. e.g. <code>PointF[0]</code> shall be the topleft point and <code>PointF[1]</code> the bottomleft (and so on in clockwise direction).</p>

<p>I tried to check the coordinates e.g. if a points x and y coordinates are the lowest of every Point in the array it is the topleft one (<strong>Image Coordinate System</strong>). And if every coordinate is the biggest, it is the bottomright point.</p>

<p>The Problem with this solution is, that it is possible, that the Points in that Array could also represent a parallelogram or a trapezoid meaning, that the angle between the corners does not have to be 90 degree.</p>

<p>Here a Image where I try to visualize what I want to achieve:</p>

<p><a href="https://i.stack.imgur.com/ksn5G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ksn5G.png" alt="Example"></a></p>