Cyclic Quadrilateral Calculator

Brahmagupta area, diagonals and circumradius.

  • Existence check
  • Three arrangements
  • Exact for integers
A small rounded clay table with a clay hoop, a four-sided clay shape inside it touching the hoop at each corner, and a few loose beads.

The guide

Four sides fix a cyclic quadrilateral's area, but only their order fixes its diagonals

Brahmagupta's area, Ptolemy's diagonals and Parameshvara's radius turn four lengths into a figure, and one inequality says whether the figure exists at all.

  • 1344 the area of the sides 25, 33, 39, 65 inscribed in a circle
  • 52 and 60 its diagonals; swap the middle sides and they become 56 and 60
  • 65/2 its circumradius, so the side of 65 is a diameter
  • 84 the area for sides 13, 14, 15 and 0: Heron's formula as a special case
  • -134.0625 the number under the root for 10, 3, 4, 2: no such quadrilateral
Read the full guide Fold the guide 7 min · 12 sources

Take four sticks of different lengths and hinge them into a loop. The loop can flex. Push on one corner and the shape changes, and so does its area. A quadrilateral is not rigid, which is why four sides alone do not fix its size. Add one more demand, that all four corners must sit on a single circle, and the flexing stops. The figure that remains is a cyclic quadrilateral, and from its sides you can read off almost everything about it.

That is the whole subject here, and it rewards slow reading. Three formulas do the work. Brahmagupta’s gives the area. Ptolemy’s gives the diagonals. Parameshvara’s gives the radius of the circle. A fourth idea, the order in which the sides are laid out, decides which answers change and which do not.

What puts four corners on one circle

Three points that are not in a line always lie on exactly one circle, which is why every triangle has a circumscribed circle. A fourth point is another matter. It lies on that circle only by luck, and most quadrilaterals are not lucky. A rhombus that is not a square is the standard example of a four-sided figure that cannot be inscribed in a circle.

Two tests catch the lucky ones. The first is about angles. A convex quadrilateral is cyclic exactly when its opposite angles add up to 180 degrees. The reason is the inscribed angle theorem: an angle at the rim of a circle is half the central angle that sees the same arc, so two opposite corners see the two arcs that together make a full turn, and their halves sum to half a turn. Euclid proved the direct statement as Proposition 22 of Book 3 of his Elements.

The second test is about lengths. Ptolemy’s theorem says that in a cyclic quadrilateral the product of the diagonals equals the sum of the products of the opposite sides. The converse is also true. If the two quantities match in a convex quadrilateral, the corners lie on a circle.

There is a third way to say it, with no angles and no products. Draw the perpendicular bisector of every side. For a cyclic quadrilateral all four meet in one point, the circumcentre, which is the same distance from every corner. The page uses this version to check itself: it finds the centre from three corners and then measures how far the fourth corner sits from it.

Four lengths, and the numbers that follow

Begin with a question that has a yes or no answer. Can four lengths be the sides of a cyclic quadrilateral at all? They can when each length is shorter than the sum of the other three. Sides 10, 3, 4 and 2 fail, because 10 is longer than 3 + 4 + 2 = 9. Half the perimeter is 9.5, and Brahmagupta’s formula would put -134.0625 under a square root, which no real number can answer. A calculator that applies the formula without this check can print nonsense with a straight face.

When the sides do exist, the area comes first. Let s be half the perimeter. The area is the square root of (s - a)(s - b)(s - c)(s - d). The formula is named after the Indian mathematician who gave it in the seventh century.

Try 25, 33, 39 and 65. Half the perimeter is 81, so the four factors are 56, 48, 42 and 16, and their product is 1806336. That is exactly 1344 squared, so the area is the whole number 1344, with nothing rounded. The diagonals come next. For sides a, b, c, d in order, the square of the diagonal AC is (ac + bd)(ad + bc) divided by (ab + cd), and the square of BD swaps the roles of the sums (ab + cd) and (ad + bc). Here the diagonals are exactly 52 and 60. Their product is 3120, which is 25 times 39 plus 33 times 65, just as Ptolemy’s theorem says.

A cyclic quadrilateral whose sides, diagonals and area are all whole numbers has a name of its own, a Brahmagupta quadrilateral. This one qualifies.

The radius of the circle comes from a formula that the fifteenth-century mathematician Vatasseri Parameshvara derived. R is a quarter of the square root of (ab + cd)(ac + bd)(ad + bc) divided by (s - a)(s - b)(s - c)(s - d). For the worked example R is exactly 65/2, so the longest side, 65, is a diameter. The inscribed angle theorem has a special case for exactly this: an angle that sees a diameter is a right angle. Check it. The triangle with sides 25, 60 and 65 is right-angled, and so is the triangle with sides 39, 52 and 65. Both stand on the side of 65.

The angles follow from the law of cosines in the two triangles that a diagonal cuts off. Corner A is 67.3801 degrees and corner C is 112.6199 degrees, and they add to 180, as a cyclic quadrilateral demands. Corners B and D, at 126.8699 and 53.1301 degrees, add to 180 as well.

Reordering the sides changes the diagonals, not the circle

Here is the part that surprises people. Swap the middle sides to get 25, 39, 33, 65 and the area does not change. It is still 1344, and R is still 65/2. The diagonals do change, to 56 and 60. Four unequal lengths can be arranged around a figure in three distinct ways, and all three give the same area and the same circumcircle. Any two of the three share one diagonal.

For 25, 33, 39 and 65 the three pairs of diagonals are 52 and 60, then 56 and 60, then 52 and 56. Any two of those pairs overlap in exactly one number, which makes a handy check on any worked answer.

The reason sits in the formulas. The area uses only s and the four sides, and s does not care about order. Parameshvara’s radius is unchanged when any side lengths are exchanged. The diagonals, however, are built from products of neighbouring sides, and neighbours are exactly what a reordering changes.

So the question “what are the diagonals of the cyclic quadrilateral with sides 25, 33, 39 and 65” is incomplete. The order matters, and an answer that ignores it is right for one arrangement and wrong for the other two.

Heron’s formula, and why the circle wins

Let one side shrink to zero. The fourth corner slides onto the first and the quadrilateral becomes a triangle. Brahmagupta’s formula then reduces to Heron’s formula for the area of a triangle. Try 13, 14, 15 and 0. Half the perimeter is 21, the four factors are 8, 7, 6 and 21, their product is 7056, and the root is 84. A triangle always has a circumscribed circle, and Parameshvara’s formula returns its radius, 65/8, with no special handling.

There is also a reason to prefer the inscribed figure. Among all quadrilaterals with the same four sides, the cyclic one has the largest area. Bretschneider’s formula shows why. It works for any quadrilateral, cyclic or not, and it subtracts a term from the number under the root: the product abcd times the square of the cosine of half the sum of two opposite angles. A square is never negative, so the term can only lower the area, and it vanishes when opposite angles add to 180 degrees, which is the cyclic case.

The page tests this claim as well as stating it. It draws the diagonal AC at random 20,000 times from a fixed starting seed, builds the two triangles that the diagonal cuts out, adds their areas and keeps the largest. For 25, 33, 39 and 65 the best of those shapes comes within a hair of 1344 and none exceeds it.

What the method cannot do

The method is narrow on purpose. It covers inscribed quadrilaterals given by four sides. A quadrilateral that is not cyclic needs one more number, an angle, and then Bretschneider’s formula takes over. A crossed quadrilateral and a figure built from angles are outside the page. For the area of any polygon from corner coordinates, a shoelace calculation is the right tool.

Sides are read as whole numbers, decimals or fractions of up to 12 characters and kept exact as big integers, so 1344 stays 1344 and 65/2 stays 65/2. A square root that is not a whole number appears as a radical next to its decimal value. The heavy work runs in a web worker, a background thread, so typing never freezes the page.

The figure itself, with its corner coordinates and measured distances, is floating point, and the checks report how far it drifts. For ordinary sides the drift is a few parts in ten quadrillion. When one side is a trillion times another, the coordinates lose more digits, and the page says so rather than hiding it.

Every number in this essay was confirmed by a separate program that does rational arithmetic with Python’s fractions module and rebuilds the figure by a different route, placing four chords on a circle instead of using a diagonal. Agreement between two methods is the best evidence a calculator can offer.

Four sides, one circle, one inequality. Check the inequality first, take the three formulas in order, and let the order of the sides decide what changes.

Sources

Every source consulted for this guide. Links checked November 11, 2026.

  1. Cyclic quadrilateral Wikipedia
  2. Brahmagupta's formula Wikipedia
  3. Ptolemy's theorem Wikipedia
  4. Heron's formula Wikipedia
  5. Bretschneider's formula Wikipedia
  6. Inscribed angle Wikipedia
  7. Concyclic points Wikipedia
  8. Law of cosines Wikipedia
  9. Brahmagupta Wikipedia
  10. BigInt - JavaScript MDN Web Docs
  11. Web Workers API MDN Web Docs
  12. fractions - Rational numbers Python Software Foundation