In geometry, Brahmagupta's formula gives the area of a cyclic quadrilateral whose sides have lengths a, b, c, d as:

where s=(a+b+c+d)/2.

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