Bretschneider formula calculator
Get the area of any four-sided shape from its four sides and a pair of opposite angles: four sides of 2 with right opposite angles give an area of 4. When those angles add up to 180°, the result matches Brahmagupta's formula. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- A
- 2
- B
- 2
- C
- 2
- D
- 2
- Alpha
- 90
- Gamma
- 90
- Angle unit
- deg
- Perimeter
- 8
- Semiperimeter
- 4
- Area
- 4
Bretschneider's formula is the standard closed form for the area of a general quadrilateral when you know the four side lengths and a pair of opposite interior angles, without needing coordinates, heights, or diagonals. Surveyors pacing an irregular four-sided lot, students checking homework on non-cyclic quads, and CAD or game pipelines that store edge lengths plus corner angles can all compute floor area in one deterministic step. This capability validates that each side is shorter than the sum of the other three, converts angles from degrees or radians, forms the semiperimeter, subtracts the cosine-squared term of half the opposite-angle sum, and returns the positive square root when the configuration is geometrically possible.
What Bretschneider's formula is and how the numbers work
Bretschneider's formula generalises Brahmagupta's formula from cyclic quadrilaterals to any simple quadrilateral. Label the four sides a, b, c, and d in order around the boundary, and let alpha and gamma be a pair of opposite interior angles—classically the angles between sides d and a, and between sides b and c. Form the semiperimeter s equal to half the sum of the four sides.
The area K is the positive square root of the product (s minus a) times (s minus b) times (s minus c) times (s minus d), minus the product a times b times c times d times the square of the cosine of half the sum of alpha and gamma. When the two opposite angles sum to one hundred eighty degrees, the cosine of ninety degrees is zero, the second term vanishes, and the formula collapses exactly to Brahmagupta's product under a single square root—the cyclic special case.
A unit square with sides one and right angles ninety and ninety yields area one; a three-by-four rectangle with sides three, four, three, four and the same right opposite angles yields area twelve, matching base times height. A rhombus with equal sides five and opposite angles sixty and sixty degrees yields area equal to side squared times sine of the included angle, which matches the Bretschneider radical after the cosine term is applied.
Every step is elementary arithmetic plus one cosine and one square root, so the result is fully deterministic and free of iteration, sampling, or wall-clock dependence.
Practical tips, limits, and related searches
For teaching, prefer paired examples: a square or rectangle to recover the familiar base-times-height check when opposite angles are right; a rhombus with equal sides and equal opposite acute angles to cross-check side squared times sine; and an intentionally impossible set of sides or angles to demonstrate the hard rejection path that protects callers from non-physical input. This landing targets people searching for a Bretschneider formula calculator or a general quadrilateral area tool from sides and opposite angles.
It is not a coordinate shoelace solver—use the dedicated quadrilateral area capability when you already have ordered vertex coordinates instead of sides and angles. Prefer Bretschneider when you measured or were given four edges and two opposite corners and have no reliable diagonal or height. Round-trip checks are easy: after solving, confirm that perimeter equals the sum of the four sides, that semiperimeter is half that, and that squaring the returned area recovers the Bretschneider radicand within floating tolerance when you recompute the cosine term by hand.
What you can do with it
Surveying and irregular lot takeoff
Turn paced edges and measured opposite corner angles of a four-sided plot into land or floor area without constructing diagonals or placing a coordinate grid.
CAD, game, and mesh validation
Validate a quad face or compute surface area when the scene graph stores edge lengths and a pair of opposite interior angles rather than full vertex coordinates.
FAQ
What is Bretschneider's formula?
Bretschneider's formula finds a quadrilateral's area from four side lengths a, b, c, d and opposite angles alpha and gamma. With semiperimeter s = (a+b+c+d)/2, the area is sqrt((s−a)(s−b)(s−c)(s−d) − abcd·cos²((alpha+gamma)/2)).
How does it relate to Brahmagupta's formula?
When opposite angles sum to 180° (a cyclic quadrilateral), the cosine term is zero and Bretschneider reduces to Brahmagupta: area = sqrt((s−a)(s−b)(s−c)(s−d)).
Which angles do I enter?
Enter one pair of opposite interior angles (alpha and gamma), not adjacent angles. Order sides a, b, c, d around the boundary so the angles sit at the correct opposite corners.
Is the Bretschneider formula calculator free?
The browser tool is free and runs locally.
Why does the calculator reject my measurements?
Because no real quadrilateral fits them. Each side must be shorter than the other three together, and the sides and angles must leave a positive value under the square root; otherwise you get a clear rejection, never a made-up area.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/geom/bretschneider-area \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a":3,"b":4,"c":5,"d":6,"alpha":90,"gamma":90}'const res = await fetch("https://api.kit.forhosting.com/geom/bretschneider-area", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a": 3,
"b": 4,
"c": 5,
"d": 6,
"alpha": 90,
"gamma": 90
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/bretschneider-area",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a": 3,
"b": 4,
"c": 5,
"d": 6,
"alpha": 90,
"gamma": 90
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/bretschneider-area", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a":3,"b":4,"c":5,"d":6,"alpha":90,"gamma":90}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a":3,"b":4,"c":5,"d":6,"alpha":90,"gamma":90}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/bretschneider-area", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"a": 3,
"b": 4,
"c": 5,
"d": 6,
"alpha": 90,
"gamma": 90
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.bretschneider_area",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Impossible side-angle combinations and degenerate zero-area cases return invalid_input instead of a fake area.
What Bretschneider's formula is and how the numbers work
If the radicand is negative, no real quadrilateral realises those measurements and the tool rejects the request rather than inventing an area.
How to call the API and what comes back
Use it from geometry homework pipelines, land takeoff scripts, mesh and CAD tooling, interview-prep sandboxes, or any workflow that needs a reproducible general-quad area without installing a computer-algebra package on every machine. Send a JSON body with four positive side lengths and two opposite angles. Fields a, b, c, and d are the sides in boundary order; aliases side_a through side_d and side1 through side4 map to the same meanings. Fields alpha and gamma are the opposite interior angles; aliases angle_a, angle1, and angle_alpha map to alpha, while angle_c, angle2, and angle_gamma map to gamma. Optional angle_unit accepts deg (default) or rad so callers can pass either convention without converting by hand. On success the response echoes a, b, c, d, alpha, gamma, and angle_unit, adds perimeter, semiperimeter, area, a boolean cyclic_special_case when the opposite-angle sum is a straight angle within floating tolerance, method set to bretschneider, and a short formula block documenting the closed forms. Failed validation—missing a required field, a non-finite number, a non-positive side, a side outside published limits, an angle outside the open range, sides that break the four-side inequality, a negative or zero Bretschneider radicand, or an invalid angle_unit—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item.
Practical tips, limits, and related searches
Keep side lengths inside the published positive range up to one trillion so intermediate products stay finite in IEEE double precision on the Worker and in the browser. Linear units are whatever you pass—metres, feet, or game units—as long as all four sides share the same unit; the API does not convert units for you. Angles default to degrees; pass angle_unit rad when your data already lives in radians. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap while learners test the contract.
Integration use cases
Homework checks for general quadrilateral area
Give students four side lengths and two opposite angles; compare their hand-computed Bretschneider area against a deterministic API or free browser result.
Technical questions
What inputs are rejected?
Non-positive sides, angles outside the open range, sides that break the four-side inequality, invalid angle_unit, and configurations whose Bretschneider radicand is negative or zero all return invalid_input.