Resources Numerical accuracy

Calculations

Every calculation under our calculation policies: what it works out, its formula and the precision it runs at. Open one to see its code as it is in the released app.

  • 6,917 calculations in 1,248 source files
  • 143 exact
  • 6,286 in 64-bit
  • 335 with a 32-bit step
  • Last reviewed

Calculations

  • Convert between two units

    A value in one unit as a value in another unit of the same kind.

    result = v × (n₁ × d₂) ÷ (d₁ × n₂)

    Unit conversion unit-table.js Every app
    Exact
  • Typed text to a unit

    What was typed, with its unit, as a value in the unit the field wants.

    3 yd typed into a feet field = convert(3, yd, ft) = 9

    Unit conversion unit-table.js Every app
    Exact
  • A value to the base unit

    A number in any unit as meters, square meters, cubic meters, radians or rise over run.

    base = v × n ÷ d (v × π × n ÷ d for degrees and gons)

    Unit conversion unit-table.js Every app
    64-bit
  • A base value to a unit

    A stored base value as a number in the unit shown.

    value = base × d ÷ n (base ÷ π × d ÷ n for degrees and gons)

    Unit conversion unit-table.js Every app
    64-bit
  • Length of a segment or arc

    The true length of one straight or curved piece of a run.

    θ = 4 · atan(b); r = c ÷ (2 · sin(θ ÷ 2)); length = r × |θ|

    Takeoff lengths and areas geom.js
    • TakeoffCraft
    64-bit
  • Area under an arc

    The area between an arc and its chord.

    area = r² × (θ − sin θ) ÷ 2

    Takeoff lengths and areas geom.js
    • TakeoffCraft
    64-bit
  • Area of an outline

    The area inside a closed outline by the shoelace formula, arcs included.

    A = ½ Σ (xᵢ · yᵢ₊₁ − xᵢ₊₁ · yᵢ) + Σ arc areas

    Takeoff lengths and areas geom.js
    • TakeoffCraft
    64-bit
  • Perimeter

    The length around a closed outline.

    P = Σ segment lengths, the closing segment included

    Takeoff lengths and areas geom.js
    • TakeoffCraft
    64-bit
  • Net area with cut-outs

    Gross area, cut-outs, net area and perimeter of an area mark.

    net = gross − Σ cut-outs

    Takeoff lengths and areas geom.js
    • TakeoffCraft
    64-bit
  • Centroid

    The center of area of an outline, where its label goes.

    C_x = Σ (xᵢ + xᵢ₊₁) · fᵢ ÷ 6A, fᵢ = xᵢ · yᵢ₊₁ − xᵢ₊₁ · yᵢ

    Takeoff lengths and areas geom.js
    • TakeoffCraft
    64-bit
  • Add, subtract, multiply, divide

    The four operations on values that carry units.

    a + b and a − b need the same dimensions; a × b and a ÷ b combine them

    Calc sheets calc.js Every app
    64-bit
  • Comparisons

    Pass or fail checks such as M <= 40 kN m.

    a ≤ b is true when a ≤ b + 1e-12 × max(1, |a|, |b|)

    Calc sheets calc.js Every app
    64-bit
  • Number shown

    A result as text in the sheet.

    6 significant digits; exponent form from 1e9 up and below 1e-4

    Calc sheets calc.js Every app
    64-bit
  • Combine two transforms

    The product of two plan transforms, each six numbers.

    [a b c d e f]: x′ = a·x + c·y + e, y′ = b·x + d·y + f

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Block insert transform

    Where the content of a block lands: insertion point, rotation, scale, base point and its place in a row and column array.

    M = T(insert) · R(rotation) · S(sx, sy) · T(−base + (col × colSpacing ÷ sx, row × rowSpacing ÷ sy))

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Tilted block seen from above

    The plan transform of an insert whose extrusion direction is neither up nor down.

    Ax = unit(Wz × N) (or Wy × N when |Nx| and |Ny| < 1/64); Ay = unit(N × Ax); offset = N·z

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Downward extrusion

    Mirrors an entity in X when its extrusion direction points down.

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Transform points

    A list of points moved through a transform into the space's coordinates.

    x′ = a·x + c·y + e; y′ = b·x + d·y + f

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Segments in an arc

    How many straight segments stand in for an arc.

    n = max(8, min(128, ⌈|sweep| ÷ 2π × 72⌉))

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Points along an arc or circle

    An arc or circle as points on it.

    pᵢ = (cx + r·cos aᵢ, cy + r·sin aᵢ), aᵢ = a₀ ± sweep × i ÷ n

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Points along an ellipse

    An ellipse or elliptical arc as points on it.

    p(t) = c + R(rot) · (L·cos t, L·ratio·sin t), L = |major axis|, rot = atan2(my, mx)

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Polyline with bulge arcs

    A polyline whose segments may be arcs, as points.

    θ = 4·atan(bulge); r = chord ÷ (2·sin(θ ÷ 2)); center = chord middle + normal × r·cos(θ ÷ 2)

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Points along a spline

    A spline as points: its fit points, or samples of the B-spline from its control points.

    de Boor: dⱼ = (1 − a)·dⱼ₋₁ + a·dⱼ, a = (u − kᵢ) ÷ (kᵢ₊ₚ₋ᵣ₊₁ − kᵢ); point = (Σ w·P) ÷ Σ w

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • What a sheet viewport looks at

    The model point at the middle of a viewport on a sheet.

    vx = target_x + cos(tw)·cx + sin(tw)·cy; vy = target_y − sin(tw)·cx + cos(tw)·cy

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • A viewport's window on the model

    The box in model space that a viewport shows, used to say when it looks at nothing.

    half width = w ÷ 2 × viewHeight ÷ h; half height = viewHeight ÷ 2; corners turned by the twist

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Picture placement

    The transform from a picture's pixels to drawing coordinates.

    world = P + u·px − v·py + v·h (pixel y runs down; P is the lower left corner)

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Lines of a paragraph of text

    Where each line of a multi-line text starts.

    pitch = h × 1.667 × line spacing; line i at insert + (top − pitch × i) along the up direction

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Text position, height and angle

    One line of text carried through the entity's transform.

    H = h × |second column of M|; angle = atan2(m₁, m₀) ± rotation (− when M mirrors)

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Paper unit of a sheet

    Whether a sheet is in inches or millimeters.

    unit = mm when the sheet is wider than 100 units, else inches

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Line weight in millimeters

    A stored line weight, in hundredths of a millimeter, as millimeters.

    mm = v ÷ 100 for 0 ≤ v ≤ 211, else 0.25

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Pointer position in drawing coordinates

    The drawing coordinates under the pointer, for the coordinate readout.

    x = cx + (px − W ÷ 2) ÷ zoom; y = cy − (py − H ÷ 2) ÷ zoom

    DWG and DXF drawings compiled for the plan view dwg-view.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Model to sheet through a viewport

    The transform that carries a model point onto the sheet through one viewport.

    k = h ÷ viewHeight; paper = center + k · R(twist) · (model − view point)

    DWG and DXF drawings compiled for the plan view dwg-view.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Millimeters per paper unit

    The size of one paper unit of a sheet in millimeters, for line weights.

    1 for millimeters, 25.4 for inches

    DWG and DXF drawings compiled for the plan view dwg-view.js
    • BimCraft
    • TakeoffCraft
    Exact
  • SI value of a file unit

    Meters per file length unit and radians per file angle unit.

    SI unit: 10^prefix; conversion-based unit: factor × factor of its base unit; by name: degree π ÷ 180, inch 0.0254, foot 0.3048

    IFC units and placements ifc/geo-ctx.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Axis placement as a matrix

    The matrix of an IfcAxis2Placement3D, 2D or IfcAxis1Placement.

    columns = (x, z × x, z, origin), x = reference direction projected square to z

    IFC units and placements ifc/geo-ctx.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • First projection axis

    The X axis of a placement: the reference direction projected into the plane normal to Z.

    x = normalize(v − z (v · z))

    IFC units and placements ifc/geo-ctx.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Cartesian transformation operator

    The matrix of an IfcCartesianTransformationOperator, uniform or not, in 2D or 3D.

    columns = (x s₁, y s₂, z s₃, origin)

    IFC units and placements ifc/geo-ctx.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • World matrix of a placement

    The position of an element in the model from its chain of relative placements.

    world = parent world × local

    IFC units and placements ifc/geo-ctx.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Grid placement

    The point where two grid axes meet, with their offsets, as a placement.

    t = ((pB − pA) × dB) ÷ (dA × dB); point = pA + dA t

    IFC units and placements ifc/geo-ctx.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Map conversion

    The matrix that takes model coordinates to map coordinates, with its rotation and scale.

    map = (E, N, H) + R(θ) · S · model; θ = atan2(ordinate, abscissa)

    IFC units and placements ifc/geo-ctx.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Matrix product

    The product of two 4 × 4 matrices.

    IFC units and placements ifc/geo-math.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Point through a matrix

    Transforms a point by a matrix.

    p' = M · (x, y, z, 1)

    IFC units and placements ifc/geo-math.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Matrix inverse

    The inverse of a 4 × 4 matrix, or null when it has none.

    M⁻¹ = adjugate ÷ determinant

    IFC units and placements ifc/geo-math.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Rotation about an axis

    The matrix that turns by an angle about an axis through the origin.

    R = c I + s [a]× + (1 − c) a aᵀ

    IFC units and placements ifc/geo-math.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Polygon normal

    The normal of a 3D polygon, with a length of twice its area.

    n = Σ ((yₐ − y_b)(zₐ + z_b), (zₐ − z_b)(xₐ + x_b), (xₐ − x_b)(yₐ + y_b))

    IFC units and placements ifc/geo-math.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Signed area of a 2D polygon

    The area of a profile outline, positive when counter-clockwise; used to orient outlines and holes.

    A = Σ (xₐ y_b − x_b yₐ) ÷ 2

    IFC units and placements ifc/geo-math.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Positions and normals handed to the app

    Packs the mesh into the vertex and index arrays the apps read.

    vertices = Float32Array of (x, y, z, nx, ny, nz) per vertex

    Triangle mesh built from IFC geometry ifc/geo-mesh.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part
  • Planar face

    Adds one planar face with holes as triangles, all with the face's normal.

    Triangle mesh built from IFC geometry ifc/geo-mesh.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Mesh moved by a matrix

    Adds another mesh, transformed, with its normals turned to match.

    p' = M p; n' = normalize((M⁻¹)ᵀ n); a mirror swaps the winding

    Triangle mesh built from IFC geometry ifc/geo-mesh.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Signed volume

    The volume enclosed by the mesh, positive when the triangles face outward.

    V = Σ a · (b × c) ÷ 6

    Triangle mesh built from IFC geometry ifc/geo-mesh.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit

A calculation is added only after its source was read. Each statement can be checked in the code shown on its policy's page; the app repositories are public. When a release changes a calculation, its page says so until it has been read again.