Formula library

CC BY 4.0 · JSON

The construction quantity formulas, with the vectors that pin them

Each equation below is the one the site's calculators run, written once in plain notation and MathML, with its symbols and units in both systems, the calculators that use it, the sources they cite and the test vectors that hold it to the code.

  • 28Formulas
  • 8Formula families
  • 87Test vectors that agree

The families

8 families of equations

Grouped by what they answer. Each page states its equations, defines every symbol and lists the vectors.

How the library is made

Generated from the calculators, checked against them

No equation here is copied from a page. Each is written once as an expression, and that one expression is drawn as MathML, printed in plain notation, exported in the JSON and evaluated. For every calculator that uses it, a binding says which inputs, breakdown lines or result feed each symbol.

Every build runs each bound calculator's pinned test vectors through its own compute function and through the equation. A vector is published only where the two agree to a millionth, and the test suite fails if any bound vector disagrees, so an equation cannot stay on this page after the code beneath it changes.

The citations are each calculator's own sources, word for word. Where a calculator cites a code or a manufacturer, the library repeats that citation; it adds none of its own.

26 calculators run these equations, and 87 of their test vectors agree with them. How the site verifies its calculators

Machine-readable

Every family as a JSON file

One file per family at /formulas/<family>.json, and an index at /formulas/index.json. Plain static files: no key, no rate limit.

id
The formula's stable identifier. It never changes; a revised equation gets a new id.
expression
The right-hand side in infix notation, with the operators and functions each file lists under expressionSyntax.
inputs / output
Each symbol with its meaning and its unit in the metric and the imperial column.
testVectors
Inputs, the formula's output, and what the calculator's compute function returned for the same vector.
calculators
The calculators that run the equation, and which of their outputs it reproduces.

https://craftquantities.com/formulas/index.json

The text and the data of the formula library are published under the Creative Commons Attribution 4.0 licence (CC BY 4.0): reuse them, in any medium and for any purpose, with a credit to Craft Quantities and a link to the page.

These are quantity equations, not design checks. Nothing here sizes a member or confirms that a structure is safe; that is for the engineer or building official responsible for the work.