[Math] How to Find all Angles of 4-sided polygon given side lengths

geometrytrigonometry

I have a program that lets users draw custom 4-sided shapes using java 2d. I want to calculate the angles inside the shapes so I can rotate text to the proper angle and label each side.

I am trying to calculate all angles of a 4-sided polygon given the length of all 4 sides. I found a formula using law of cosines for a cyclic quadrilateral, but I don't know that all of my shapes will be cyclic since they are user defined and can be any 4 points in a 2d coordinate system.

Is my only option to find the diagonals and start piecing it together with law of cosines for each triangle?

Best Answer

The lengths don't determine the angles: for example with all sides equal you have a rhombus, where the angle at any vertex could be anything in the interval $(0, \pi)$.