Brahmagupta's formula

In geometry, Brahmagupta's formula finds the area of any quadrilateral given the lengths of the sides and some of their angles. In its most common form, it yields the area of quadrilaterals that can be inscribed in a circle.

Basic form
In its basic and easiest-to-remember form, Brahmagupta's formula gives the area of a cyclic quadrilateral whose sides have lengths a, b, c, d as


 * $$\sqrt{(s-a)(s-b)(s-c)(s-d)}$$

where s, the semiperimeter, is


 * $$s=\frac{a+b+c+d}{2}\cdot$$

This formula generalizes Heron's formula for the area of a triangle.

The assertion that the area of the quadrilateral is given by Brahmagupta's formula is equivalent to the assertion that it is equal to


 * $$\sqrt{\frac{(a^2+b^2+c^2+d^2)^2}{16}+\frac{abcd}{2}-\frac{a^4+b^4+c^4+d^4}{8}}\cdot$$

Brahmagupta's formula may be seen as a formula in the half-lengths of the sides, but it also gives the area as a formula in the altitudes from the center to the sides, although if the quadrilateral does not contain the center, the altitude to the longest side must be taken as negative.

Proof of Brahmagupta's formula


Area of the cyclic quadrilateral = Area of $$\triangle ADB$$ + Area of $$\triangle BDC$$


 * $$= \frac{1}{2}pq\sin A + \frac{1}{2}rs\sin C.$$

But since $$ABCD$$ is a cyclic quadrilateral, $$\angle DAB = 180^\circ - \angle DCB.$$ Hence $$\sin A = \sin C.$$ Therefore


 * $$\mbox{Area} = \frac{1}{2}pq\sin A + \frac{1}{2}rs\sin A$$


 * $$(\mbox{Area})^2 = \frac{1}{4}\sin^2 A (pq + rs)^2$$


 * $$4(\mbox{Area})^2 = (1 - \cos^2 A)(pq + rs)^2 \,$$


 * $$4(\mbox{Area})^2 = (pq + rs)^2 - cos^2 A (pq + rs)^2. \,$$

Applying law of cosines for $$\triangle ADB$$ and $$\triangle BDC$$ and equating the expressions for side $$DB,$$ we have


 * $$p^2 + q^2 - 2pq\cos A = r^2 + s^2 - 2rs\cos C. \,$$

Substituting $$\cos C = -\cos A$$ (since angles $$A$$ and $$C$$ are supplementary) and rearranging, we have


 * $$2\cos A (pq + rs) = p^2 + q^2 - r^2 - s^2. \,$$

Substituting this in the equation for area,


 * $$4(\mbox{Area})^2 = (pq + rs)^2 - \frac{1}{4}(p^2 + q^2 - r^2 - s^2)^2$$


 * $$16(\mbox{Area})^2 = 4(pq + rs)^2 - (p^2 + q^2 - r^2 - s^2)^2, \,$$

which is of the form $$a^2-b^2$$ and hence can be written in the form $$(a+b)(a-b)$$ as


 * $$(2(pq + rs) + p^2 + q^2 -r^2 - s^2)(2(pq + rs) - p^2 - q^2 + r^2 +s^2) \,$$


 * $$= ( (p+q)^2 - (r-s)^2 )( (r+s)^2 - (p-q)^2 ) \,$$


 * $$= (p+q+r-s)(p+q+s-r)(p+r+s-q)(q+r+s-p). \,$$

Introducing $$S = \frac{p+q+r+s}{2},$$


 * $$16(\mbox{Area})^2 = 16(S-p)(S-q)(S-r)(S-s). \,$$

Taking square root, we get


 * $$\mbox{Area} = \sqrt{(S-p)(S-q)(S-r)(S-s)}.$$

Extension to non-cyclic quadrilaterals
In the case of non-cyclic quadrilaterals, Brahmagupta's formula can be extended by considering the measures of two opposite angles of the quadrilateral:


 * $$\sqrt{(s-a)(s-b)(s-c)(s-d)-abcd\cos^2\theta}$$

where θ is half the sum of two opposite angles. (The pair is irrelevant: if the other two angles are taken, half their sum is the supplement of θ. Since cos(180° &minus; θ) = &minus;cosθ, we have cos2(180° &minus; θ) = cos2θ.) It follows from this fact that the area of a cyclic quadrilateral is the maximum possible area for any quadrilateral with the given side lengths.

This more general formula is sometimes known as Bretschneider's formula, but according to MathWorld is apparently due to Coolidge in this form, Bretschneider's expression having been


 * $$\sqrt{(s-a)(s-b)(s-c)(s-d)-\textstyle{1\over4}(ac+bd+pq)(ac+bd-pq)}\,$$

where p and q are the lengths of the diagonals of the quadrilateral.

It is a property of cyclic quadrilaterals (and ultimately of inscribed angles) that opposite angles of a quadrilateral sum to 180°. Consequently, in the case of an inscribed quadrilateral, θ = 90°, whence the term


 * $$abcd\cos^2\theta=abcd\cos^2 \left(90^\circ\right)=abcd\cdot0=0, \,$$

giving the basic form of Brahmagupta's formula.

Related theorems
Heron's formula for the area of a triangle is the special case obtained by taking d = 0.

The relationship between the general and extended form of Brahmagupta's formula is similar to how the law of cosines extends the Pythagorean theorem.