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

  • Complete combustion of a stream

    The CO2 and water produced, the oxygen needed and the heat released when a stream is burned.

    CO2 = Σ nᵢ × Cᵢ; H2O = Σ nᵢ × Hᵢ ÷ 2; O2 = Σ nᵢ × (Cᵢ + Hᵢ ÷ 4 − Oᵢ ÷ 2); kg CO2 = CO2 × 0.04401

    Process emissions (CO2 equivalent) process/emissions.js
    • CadCraft
    • BimCraft
    64-bit
  • Vented stream as CO2 equivalent

    The CO2-equivalent mass flow of a stream released to the air.

    CO2e = Σ F × zᵢ × MWᵢ × GWPᵢ

    Process emissions (CO2 equivalent) process/emissions.js
    • CadCraft
    • BimCraft
    64-bit
  • Emissions report

    The emission of each tagged stream, fired unit and electric unit, the total per second and the total per year.

    fired: CO2e = |Q| ÷ efficiency ÷ 1.055056e9 × factor; electric: CO2e = (|W| + |Q|) ÷ 3.6e6 × grid factor; per year = total × 3600 × hours

    Process emissions (CO2 equivalent) process/emissions.js
    • CadCraft
    • BimCraft
    64-bit
  • A stream's duty on one side of the pinch

    How much heat a stream has to give or take above the pinch, and below it.

    above, hot: Q = CP × (Ts − max(Tt, T_pinch)); above, cold: Q = CP × (Tt − max(Ts, T_pinch))

    Heat-exchanger network design process/hen.js
    • CadCraft
    • BimCraft
    64-bit
  • Choosing the next match

    Which hot and cold stream are matched next: streams at the pinch first, then the largest duty.

    score = 1e9 × (streams at the pinch) + min(remaining hot, remaining cold)

    Heat-exchanger network design process/hen.js
    • CadCraft
    • BimCraft
    64-bit
  • Duty and end temperatures of a match

    The heat a match exchanges, the temperatures of both streams at its two ends and whether it keeps the minimum temperature difference.

    Q = min(remaining hot, remaining cold); ΔT_hot = Q ÷ CP_hot; ΔT_cold = Q ÷ CP_cold; d₁ = |T_hot,₀ − T_cold,₀|; d₂ = |T_hot,₁ − T_cold,₁|

    Heat-exchanger network design process/hen.js
    • CadCraft
    • BimCraft
    64-bit
  • Heaters, coolers and totals

    The heating and cooling the matches leave over, and the number of units against the minimum.

    Q_H = Σ heater duties; Q_C = Σ cooler duties; units = matches + heaters + coolers

    Heat-exchanger network design process/hen.js
    • CadCraft
    • BimCraft
    64-bit
  • Numbers written on the grid drawing

    The CP, temperatures and duties shown as text on the network grid.

    label = value rounded to 1 decimal

    Heat-exchanger network design process/hen.js
    • CadCraft
    • BimCraft
    64-bit
  • Energy, cost and CO2 of a variant

    The totals a variant is judged by: heating, cooling and shaft power in kW, operating cost per hour and kg CO2 per hour.

    cost/h = (heat × p_heat + cool × p_cool) × 3600 ÷ 1e9 + (shaft ÷ 1e3) × p_power; CO2/h = (heat × 3600 ÷ 1e9) × f_heat + (shaft ÷ 1e3) × f_power

    Flowsheet variant metrics process/optimise.js
    • CadCraft
    • BimCraft
    64-bit
  • Proposed composition from lab results

    The mole fractions a sample's results give for a stream, for a person to accept or reject.

    w = % ÷ 100; w = ppm × 1e-6; w = (mg/L × 1e-3) ÷ ρ; nᵢ = wᵢ ÷ MWᵢ; zᵢ = nᵢ ÷ Σ n

    Lab results to stream composition process/env/lims.js
    • CadCraft
    • BimCraft
    64-bit
  • Calculated composition for the lab system

    A stream's composition as mass or mole fractions, percent or ppm, to send back as calculated values.

    wᵢ = zᵢ × MWᵢ ÷ Σ(z × MW); mass % = w × 100; ppm = w × 1e6

    Lab results to stream composition process/env/lims.js
    • CadCraft
    • BimCraft
    64-bit
  • Rational tag value

    A TIFF RATIONAL (two 32-bit integers) as one number.

    value = numerator ÷ denominator

    TIFF scan resolution raster/tiff.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Resolution in dots per inch

    The horizontal and vertical resolution of a page, in dots per inch.

    dpi = resolution × 2.54 (centimeter files); dpi = resolution (inch files)

    TIFF scan resolution raster/tiff.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit
  • Triangulate a polygon with holes

    The triangles of a polygon, as indexes into its point list.

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Winding of a ring

    Whether a ring runs clockwise or counterclockwise.

    sum = Σ (xⱼ − xᵢ) × (yᵢ + yⱼ)

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Orientation of three points

    On which side of the line through two points a third point lies.

    area = (q.y − p.y) × (r.x − q.x) − (q.x − p.x) × (r.y − q.y)

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Removing duplicate and collinear points

    Drops points that repeat their neighbor or lie on the line between their neighbors.

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Ear test

    Whether a corner can be cut off as a triangle: it is convex and no other point of the ring lies inside it.

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Point in triangle

    Whether a point lies inside or on a triangle.

    three cross products of (corner − point) pairs, each ≥ 0

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Bridge from a hole to the outer ring

    The point of the outer ring a hole is connected to.

    x = p.x + (h.y − p.y) × (p′.x − p.x) ÷ (p′.y − p.y); tan = |h.y − p.y| ÷ (h.x − p.x)

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Do two segments cross

    Whether two edges intersect, including touching and collinear overlap.

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Is the middle of a diagonal inside the polygon

    Whether a diagonal between two corners runs through the inside of the polygon.

    midpoint = ((a.x + b.x) ÷ 2, (a.y + b.y) ÷ 2); even-odd count of edges crossed by a ray

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Value of a number row

    The number handed to the app when a person changes a number box.

    v = min(max, max(min, typed value))

    Numbers typed into the property grid app-propgrid.js Every app
    64-bit
  • Rounding of a slider value

    Removes binary noise such as 0.30000000000000004 from a slider's value.

    v = round to (decimals of the step + 2) decimals, at most 8

    Numbers typed into the property grid app-propgrid.js Every app
    64-bit
  • Value of a slider row

    The number handed to the app while a slider is dragged or its box is changed.

    v = fix(clamp(value, min, max), step)

    Numbers typed into the property grid app-propgrid.js Every app
    64-bit
  • Integer or float

    Decides how a number is written.

    Numbers sent between people editing together live-client.js Every app
    64-bit
  • Writing a float

    Writes a number as 8 bytes.

    Numbers sent between people editing together live-client.js Every app
    64-bit
  • Writing an integer

    Writes a whole number in the shortest integer form that holds it.

    Numbers sent between people editing together live-client.js Every app
    Exact
  • Reading a float

    Reads a 4-byte or an 8-byte float from a message.

    Numbers sent between people editing together live-client.js Every app
    64-bit
  • Reading a 64-bit integer

    Reads an unsigned or signed 64-bit integer.

    Numbers sent between people editing together live-client.js Every app
    Exact
  • Cost of one call

    The cost of a call from its token counts and the model's prices.

    cost = (in × price in + out × price out) ÷ 1,000,000

    Spending on a person's own AI model ai-byok.js Every app
    64-bit
  • Spending today and this month

    The cost, tokens and number of calls for the current day and month, and the calls in the last hour.

    amount = Σ cost of the calls in the period

    Spending on a person's own AI model ai-byok.js Every app
    64-bit
  • Check before a call

    Refuses a call when the calls per hour, the day's or month's spending, or the day's tokens could pass a limit.

    refuse when spent + worst-case cost > limit; worst case = cost(estimated input, largest allowed output)

    Spending on a person's own AI model ai-byok.js Every app
    64-bit
  • Recorded cost and the token estimate

    Stores each call's cost and estimates the input tokens of the next request.

    estimated tokens = ⌈JSON length ÷ 3⌉ + 500

    Spending on a person's own AI model ai-byok.js Every app
    64-bit
  • Flow through a passage

    Persons per second through a door or corridor of a given width.

    rate = max(0, Fsm × (width − 2 × boundary))

    People flow and evacuation time people.js Every app
    64-bit
  • Speed and specific flow at a density

    Walking speed and flow per meter of width at a given density of people.

    S = k × (1 − 0.266 × D); Fs = S × D; k = 1.4 m/s

    People flow and evacuation time people.js Every app
    64-bit
  • Rate and speed of each passage

    The flow rate and walking speed each passage gets, from its own values or the defaults for its kind.

    People flow and evacuation time people.js Every app
    64-bit
  • Door service time and walking time

    How long a door takes per person, how long the passage takes to walk, and each room's distance to an exit in time.

    service = 1 ÷ rate; walk = length ÷ speed; to exit = least total walking time

    People flow and evacuation time people.js Every app
    64-bit
  • Which way a room empties

    The next passage for people in a room: the one with the least remaining walking time to an exit.

    keep a hop when toExit(next) < toExit(room) − 1e-9; choose the least walk + toExit(next)

    People flow and evacuation time people.js Every app
    64-bit
  • Evacuation results

    People evacuated, the time the last person reaches an exit, peak occupancy and density per room, and queues per door.

    time = latest arrival at any exit; density = peak people in a room ÷ its area

    People flow and evacuation time people.js Every app
    64-bit
  • Joint frames at a pose

    Each joint's rotation and offset from its parent at the given joint values.

    Rigid-body dynamics of a mechanism dynamics.js Every app
    64-bit
  • Joint torques for a motion (inverse dynamics)

    The torque or force each joint needs for given positions, velocities and accelerations, with gravity, external loads and damping.

    outward: ω, α, a of each link; F = m × a_com; N = I α + ω × (I ω); inward: τᵢ = axis · n (revolute) or axis · f (prismatic) + damping × q̇ᵢ

    Rigid-body dynamics of a mechanism dynamics.js Every app
    64-bit
  • Mass matrix

    The joint-space mass matrix at a pose.

    column j = rnea(q, q̇ = 0, q̈ = unit vector j) with no gravity, damping or external loads

    Rigid-body dynamics of a mechanism dynamics.js Every app
    64-bit
  • Joint accelerations for given torques (forward dynamics)

    The acceleration of each joint under applied torques.

    M q̈ = τ − h

    Rigid-body dynamics of a mechanism dynamics.js Every app
    64-bit
  • Kinetic and potential energy

    The mechanism's kinetic, potential and total energy at a pose and velocity.

    KE = ½ q̇ᵀ M q̇; PE = −Σ m × (g · p_com)

    Rigid-body dynamics of a mechanism dynamics.js Every app
    64-bit
  • Simulated motion over time

    Joint positions and velocities at each time step under gravity and applied torques.

    RK4: y₊ = y + dt ÷ 6 × (k₁ + 2k₂ + 2k₃ + k₄); steps = round(T ÷ dt); t = step × dt

    Rigid-body dynamics of a mechanism dynamics.js Every app
    64-bit
  • Courtyard of a footprint

    The rectangle around all pads, grown by a margin.

    courtyard = (min(x − w ÷ 2) − m, min(y − h ÷ 2) − m, max(x + w ÷ 2) + m, max(y + h ÷ 2) + m)

    Parametric PCB footprints footlib.js Every app
    64-bit
  • Two-terminal chip

    Two pads at half the pitch either side of the center.

    x = ∓ pitch ÷ 2

    Parametric PCB footprints footlib.js Every app
    64-bit
  • Dual-row surface-mount package

    Pads in two rows, numbered counter-clockwise from the top left.

    y = ((n ÷ 2 − 1) ÷ 2 − i) × pitch; x = ∓ row spacing ÷ 2

    Parametric PCB footprints footlib.js Every app
    64-bit
  • Dual in-line through-hole package

    Drilled pads in two rows.

    y = ((n ÷ 2 − 1) ÷ 2 − i) × pitch; x = ∓ row spacing ÷ 2

    Parametric PCB footprints footlib.js Every app
    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.