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

  • Pool fire

    Flame height, heat release and ground distances to each flux level for a burning pool.

    H = 42·D × (m″ ÷ (ρ_a·√(g·D)))^0.61; ground = √(r² − (H ÷ 2)²)

    Release, fire, explosion and toxic screening process/safety/consequence.js
    • CadCraft
    • BimCraft
    64-bit
  • TNT-equivalent mass

    The mass of TNT with the same explosion energy as the fuel.

    W = η × m × ΔH_c ÷ E_TNT

    Release, fire, explosion and toxic screening process/safety/consequence.js
    • CadCraft
    • BimCraft
    64-bit
  • Blast overpressure

    The side-on overpressure at a distance from a TNT charge.

    Z = R ÷ ∛W; P ÷ P_a = 808·(1 + (Z ÷ 4.5)²) ÷ √((1 + (Z ÷ 0.048)²)(1 + (Z ÷ 0.32)²)(1 + (Z ÷ 1.35)²))

    Release, fire, explosion and toxic screening process/safety/consequence.js
    • CadCraft
    • BimCraft
    64-bit
  • Distance to an overpressure

    The distance at which the blast overpressure falls to a given level.

    Release, fire, explosion and toxic screening process/safety/consequence.js
    • CadCraft
    • BimCraft
    64-bit
  • Probit of a dose

    The probit value for a concentration and exposure time.

    Pr = a + b × ln(Cⁿ × t)

    Release, fire, explosion and toxic screening process/safety/consequence.js
    • CadCraft
    • BimCraft
    64-bit
  • Error function

    The error function used to turn a probit into a probability.

    erf(x) ≈ 1 − (a₁t + a₂t² + a₃t³ + a₄t⁴ + a₅t⁵)·e^(−x²), t = 1 ÷ (1 + 0.3275911·|x|)

    Release, fire, explosion and toxic screening process/safety/consequence.js
    • CadCraft
    • BimCraft
    64-bit
  • Probability from a probit

    The probability that corresponds to a probit value.

    P = ½ × (1 + erf((Pr − 5) ÷ √2))

    Release, fire, explosion and toxic screening process/safety/consequence.js
    • CadCraft
    • BimCraft
    64-bit
  • Blast curve interpolation

    Reads a scaled overpressure or duration from the curve points a person typed.

    ln y = ln y₀ + (ln y₁ − ln y₀) × (ln R − ln R₀) ÷ (ln R₁ − ln R₀)

    Release, fire, explosion and toxic screening process/safety/blast.js
    • CadCraft
    • BimCraft
    64-bit
  • Sachs scaling length

    The length that scales distances for an explosion of a given energy.

    L = ∛(E ÷ P₀)

    Release, fire, explosion and toxic screening process/safety/blast.js
    • CadCraft
    • BimCraft
    64-bit
  • Multi-energy overpressure

    The overpressure and positive duration at a distance from a blast source of given energy and strength.

    R̄ = R ÷ L; ΔP = P̄(R̄) × P₀; duration = t̄(R̄) × L ÷ 340

    Release, fire, explosion and toxic screening process/safety/blast.js
    • CadCraft
    • BimCraft
    64-bit
  • Distance to a multi-energy overpressure

    The distance at which the overpressure of a blast source falls to a given level.

    Release, fire, explosion and toxic screening process/safety/blast.js
    • CadCraft
    • BimCraft
    64-bit
  • Overpressure from several sources

    The overpressure at a point from each blast source and which one governs.

    E = volume × energy density; R = max(distance, 0.01 m)

    Release, fire, explosion and toxic screening process/safety/blast.js
    • CadCraft
    • BimCraft
    64-bit
  • Blast contour circles

    Circles on the site plan at given overpressure levels.

    Release, fire, explosion and toxic screening process/safety/blast.js
    • CadCraft
    • BimCraft
    64-bit
  • Heavy-gas cloud spreading

    Radius, height, concentration and drift of a dense gas cloud over time, and when it dilutes to a given concentration.

    dR/dt = Cg·√(g′·H); dV/dt = π·R²·a_top·u* + 2π·R·H·a_edge·dR/dt; g′ = g·(ρ − ρ_a) ÷ ρ_a

    Release, fire, explosion and toxic screening process/safety/heavygas.js
    • CadCraft
    • BimCraft
    64-bit
  • Dilution flow, volume and radius

    The ventilation flow needed to dilute a release, the hypothetical flammable volume and the radius of a sphere of that volume.

    LFL_m = LFL × M × P ÷ (R·T); Q_min = rate ÷ (k × LFL_m) × (T ÷ 293); V_z = f × Q_min ÷ C; r = ∛(3V_z ÷ 4π)

    Hazardous area extents and zone geometry process/safety/area.js
    • CadCraft
    • BimCraft
    64-bit
  • Zone extent and shape

    The extent of each zone and its shape: a sphere, or a ground-to-top cylinder for a heavy vapor.

    sphere: center (x, y, z), radius r; cylinder: z from 0 to z + r

    Hazardous area extents and zone geometry process/safety/area.js
    • CadCraft
    • BimCraft
    64-bit
  • Zone sections

    The outline of each zone where a vertical plane cuts it.

    half-width = √(r² − d²)

    Hazardous area extents and zone geometry process/safety/area.js
    • CadCraft
    • BimCraft
    64-bit
  • Point inside a zone

    Whether an item's position lies inside a zone volume.

    sphere: |p − c| ≤ r; cylinder: plan distance ≤ r and z₀ ≤ z ≤ z₁

    Hazardous area extents and zone geometry process/safety/area.js
    • CadCraft
    • BimCraft
    64-bit
  • Circle as a polygon

    The ring of points that stands for a circular zone in exported files.

    (cx + r·cos(2π·k ÷ 48), cy + r·sin(2π·k ÷ 48)), rounded to 6 decimals

    Hazardous area extents and zone geometry process/safety/zones.js
    • CadCraft
    • BimCraft
    64-bit
  • Zone footprints as GeoJSON

    The plan footprints of the zones as a GeoJSON file in local meters.

    Hazardous area extents and zone geometry process/safety/zones.js
    • CadCraft
    • BimCraft
    64-bit
  • Zone footprints as DXF

    The same footprints as DXF polylines, one layer per level.

    Hazardous area extents and zone geometry process/safety/zones.js
    • CadCraft
    • BimCraft
    64-bit
  • Zone volume mesh

    A closed triangle mesh of a sphere, hemisphere, cylinder or extruded polygon zone.

    Hazardous area extents and zone geometry process/safety/zones.js
    • CadCraft
    • BimCraft
    64-bit
  • Mesh volume

    The volume enclosed by a closed triangle mesh.

    V = Σ p · (q × r) ÷ 6

    Hazardous area extents and zone geometry process/safety/zones.js
    • CadCraft
    • BimCraft
    64-bit
  • Release sources from the diagram

    Release sources with position, pressure and temperature taken from the equipment on a process diagram.

    P₀ = 101325 + dp × 10⁵; T = dt + 273.15; position = drawing coordinate × factor, rounded to 6 decimals

    Hazardous area extents and zone geometry process/safety/zones.js
    • CadCraft
    • BimCraft
    64-bit
  • Mitigated event frequency

    The frequency of a scenario after its protection layers, against the target.

    f = Σ f_IE × Π p_modifier × Π PFD_IPL; required PFD = target ÷ f

    Layer of protection and SIL arithmetic process/safety/lopa.js
    • CadCraft
    • BimCraft
    64-bit
  • Required PFD of a new layer

    The probability of failure a safety function must reach to close the gap.

    required PFD = target ÷ (frequency without that layer)

    Layer of protection and SIL arithmetic process/safety/lopa.js
    • CadCraft
    • BimCraft
    64-bit
  • SIL band of a PFD

    The safety integrity level a probability of failure on demand falls in.

    SIL n when 10^−(n+1) ≤ PFD < 10^−n

    Layer of protection and SIL arithmetic process/safety/lopa.js
    • CadCraft
    • BimCraft
    64-bit
  • Unavailability of one channel

    The probability that one channel has failed dangerously at a time since new.

    u(t) = 1 − exp(−λ_t·(t mod TI) − λ_n·t)

    Layer of protection and SIL arithmetic process/safety/lopa.js
    • CadCraft
    • BimCraft
    64-bit
  • PFDavg by the simplified equations

    The average probability of failure on demand for each voting architecture.

    1oo1: λ·TI ÷ 2; 1oo2: ((1 − β)λ·TI)² ÷ 3 + β·λ·TI ÷ 2; 2oo3: ((1 − β)λ·TI)² + β·λ·TI ÷ 2

    Layer of protection and SIL arithmetic process/safety/lopa.js
    • CadCraft
    • BimCraft
    64-bit
  • PFDavg by averaging over the life

    The average probability of failure on demand with imperfect proof tests, by numerical averaging.

    PFDavg = (1 ÷ life) × ∫₀^life [P(at least N − K + 1 channels failed) + common cause] dt

    Layer of protection and SIL arithmetic process/safety/lopa.js
    • CadCraft
    • BimCraft
    64-bit
  • Safety function total

    The PFDavg of each subsystem, their total and the SIL of the total.

    PFDavg = Σ subsystem PFDavg

    Layer of protection and SIL arithmetic process/safety/lopa.js
    • CadCraft
    • BimCraft
    64-bit
  • Line fit

    The best straight line through a run of center-line pixels, and how far the worst pixel lies from it.

    θ = ½ × atan2(2·Sxy, Sxx − Syy); ends = feet of the first and last points on the line through the centroid

    Tracing a scan into lines and arcs raster/trace.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Circle fit

    The best circle through a run of center-line pixels, its sweep and the angles of an arc.

    Kåsa: solve the 2 × 2 system for the center about the centroid, r = √(uc² + vc² + (Suu + Svv) ÷ n); then Gauss-Newton on d − r

    Tracing a scan into lines and arcs raster/trace.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Corner detection

    Where a chain of pixels turns sharply, so it can be cut there before fitting.

    turn = |atan2(r − q) − atan2(q − p)| over ± w steps; corner when turn ≥ 0.6 rad and largest nearby

    Tracing a scan into lines and arcs raster/trace.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Splitting a chain into lines and arcs

    Fits a line, else an arc, else splits the chain at the point farthest from its chord, and joins neighbors that fit as one.

    distance to chord = |(P − A) × (B − A)| ÷ |B − A|

    Tracing a scan into lines and arcs raster/trace.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Joining collinear lines

    Merges two lines that lie on the same straight line and nearly touch.

    Tracing a scan into lines and arcs raster/trace.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Squaring level and plumb lines

    Makes nearly horizontal and vertical lines exactly so, and gives lines of one wall the same coordinate.

    y = (y₁ + y₂) ÷ 2; shared coordinate = Σ(coordinate × length) ÷ Σ length

    Tracing a scan into lines and arcs raster/trace.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Closing corners

    Moves a line end to the point where its line meets a nearby line.

    s = ((B₁ − E) × v) ÷ (u × v); new end = E + s·u

    Tracing a scan into lines and arcs raster/trace.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Lines and arcs in image coordinates

    The traced lines and arcs with the window offset added and the arc end points worked out.

    start = (cx + r·cos a₀, cy + r·sin a₀); end = (cx + r·cos a₁, cy + r·sin a₁)

    Tracing a scan into lines and arcs raster/trace.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Crossing of two traced lines

    The point where two traced line segments cross.

    d = (a₂ − a₁) × (b₂ − b₁); t = ((b₁ − a₁) × (b₂ − b₁)) ÷ d; point = a₁ + t·(a₂ − a₁)

    Tracing a scan into lines and arcs raster/snap.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Snap points of a trace

    The ends, middles, arc centers, corners and crossings offered for snapping.

    middle = (p₁ + p₂) ÷ 2; arc middle at angle (a₀ + a₁) ÷ 2; corner = mean of the ends within 3 px

    Tracing a scan into lines and arcs raster/snap.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Black-and-white level (Otsu)

    The grey level that best separates ink from paper for the whole sheet.

    maximize w_B × w_F × (m_B − m_F)² over the 256 levels

    Scan clean-up and JPEG decoding raster/image.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Local threshold (Sauvola)

    Decides ink or paper for each pixel from the mean and spread of the pixels around it.

    ink when v ≤ mean × (1 + k × (sd ÷ 128 − 1)); sd = √(Σv² ÷ n − mean²)

    Scan clean-up and JPEG decoding raster/image.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Sheet skew angle

    The angle by which the long lines of a scanned sheet are rotated.

    score(angle) = Σ rows² + Σ columns² of the ink projected at that angle; best angle on a 0.25° then 0.02° grid

    Scan clean-up and JPEG decoding raster/image.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Rotating the image

    Turns a grey image by an angle about its middle.

    source = c + R(angle) × (pixel − c); value = bilinear mix of the 4 nearest source pixels

    Scan clean-up and JPEG decoding raster/image.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • JPEG inverse cosine transform

    Turns the stored frequency coefficients of an 8 × 8 block back into pixel values.

    pixel = round(Σ_u Σ_v C(x,u)·C(y,v)·coef(u,v) + 128), clamped to 0–255

    Scan clean-up and JPEG decoding raster/jpeg.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • JPEG color conversion

    Converts the decoded luminance and color-difference values to red, green and blue.

    R = Y + 1.402·Cr; G = Y − 0.344136·Cb − 0.714136·Cr; B = Y + 1.772·Cb

    Scan clean-up and JPEG decoding raster/jpeg.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Table values in millimeters

    Converts each published row to millimeters, mm² and kg/m.

    mm = in × 25.4; mm² = in² × 25.4 × 25.4; kg/m = lb/ft × 1.48816394; r = (k_des − t_f) × 25.4

    Steel section dimensions, areas and outlines shapes/sections.js
    • CadCraft
    • BimCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Exact section area

    The cross-section area worked out from the dimensions, with fillets and rounded corners included.

    I: 2·b_f·t_f + (d − 2t_f)·t_w + (4 − π)·r²; RHS: 2t(h + b − 2t) − (4 − π)(r_o² − r_i²); CHS: π(D − t)·t

    Steel section dimensions, areas and outlines shapes/sections.js
    • CadCraft
    • BimCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Section outline

    The outline of a section as loops of points, centered on its bounding box.

    arc point = (cx + r·cos a, cy + r·sin a), a = a₀ + (a₁ − a₀)·i ÷ n

    Steel section dimensions, areas and outlines shapes/sections.js
    • CadCraft
    • BimCraft
    • DetailCraft
    • PartCraft
    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.