Solve for quadrilateral with minimal difference between interior angles

Given an arbitrary quadrilateral with known side lengths and one input angle (the single degree of freedom), I am trying to pick the input angle that minimizes the difference between the resulting other 3 angles.

I want each of the calculated angles to be as close to each other as possible: for example some configurations result in one angle being 180° while another is 90°. My goal in this case would be to choose an input angle such that these two angles are more "evenly spaced", like 135° and 135° for example. I'm not sure what relations or equations I would need to figure this out, but any direction would be helpful!

Some Clarification:

Let the quadrilateral have sides $a, b, c, d$ where all sides have known lengths and fixed order. Let $\theta$ be the input angle between $a$ and $b$. Let $\phi$ be the angle between $b$ and $c$, and $\gamma$ be the angle between $c$ and $d$. I would like to find a value for $\theta$ such that $\phi - \gamma$ is minimal.

• @hardmath yes I wasnt sure how to word it precisely but I want to make the 3 angles as nearly equal as possible. Yes the order of the edges is known and fixed so the input angle is always between the same two sides Aug 7 '18 at 17:10
• You've changed the goal from making all three angles other than the input $\theta$ as close to each other as possible to minimizing the (absolute value of?) $\phi - \gamma$. In addition I'd like to know if $\theta$ can be a reflexive angle (greater than 180°). Note that if $a\gt b$ and $d\gt c$, then we can make all three of the angles except $\theta$ arbitrarily small by making $\theta$ arbitrarily close to 360°. Aug 8 '18 at 4:57
• I've been thinking about this, and my intuition is that the optimum occurs when the quadrilateral is "most nearly circumscribable" whatever that means. Perhaps that Ptolmey's theorem is closest to being satisfied? I haven't been able to prove anything. I plan to try to solve some solutions numerically later today, to see if they cast any light. If anything interesting turns up, I'll post it. Aug 8 '18 at 14:40
• @saulspatz Thats funny, I had the same suspicions about it being circumscribable! Thanks so much for digging in to this with me Aug 8 '18 at 15:04
• @saulspatz: A set of four side lengths which forms a quadrilateral will always agree with sides of a cyclic quadrilateral, i.e. exactly "circumscribable". So it's a natural starting point to consider in this problem. However it isn't clear that the OP requires a convex quadrilateral, and without that the minimization might be "attatined" at a degenerate quadrilateral as I outline in the previous Comment. Aug 8 '18 at 15:12

So as @saulspatz intuited, treating the quadrilateral as cyclic gives the best solution with the given restrictions. The input angle $\theta$ can be calculated as follows:
$$cos(\theta) = \frac{(a^2 + d^2 - b^2 - c^2)}{2(ad + bc)}$$