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

  • Quantities file for TakeoffCraft

    The quantity rows in the format TakeoffCraft reads.

    qty = round(qty, 2)

    Power line tables, quantities and GIS export powerline/outputs.js
    • CivilCraft
    64-bit
  • Meters per unit

    The length of each supported unit in meters.

    ft = 0.3048; US survey ft = 1200 ÷ 3937; in = 0.0254; yd = 0.9144; mi = 1609.344

    Placing a scanned sheet in the project scanstart/place.js
    • CivilCraft
    Exact
  • Scale from two points

    Project units per pixel from two points on the scan and the true distance between them.

    units per pixel = distance ÷ √(Δpx² + Δpy²)

    Placing a scanned sheet in the project scanstart/place.js
    • CivilCraft
    64-bit
  • Scale from a stated scale

    Project units per pixel from the scan's resolution and a scale such as 1 inch = 50 feet or 1:500.

    per ÷ dpi, or ratio × 0.0254 ÷ (m per unit) ÷ dpi

    Placing a scanned sheet in the project scanstart/place.js
    • CivilCraft
    64-bit
  • Placement from a scale, origin and rotation

    The transform that puts the sheet's lower-left corner at a point, turned by an angle, at a given scale.

    c = s·cos θ, d = s·sin θ; X = x₀ − d·h + c·px + d·py; Y = y₀ + c·h + d·px − c·py

    Placing a scanned sheet in the project scanstart/place.js
    • CivilCraft
    64-bit
  • Pixel to project coordinates

    The project position of a pixel.

    X = g₀ + g₁·px + g₂·py; Y = g₃ + g₄·px + g₅·py

    Placing a scanned sheet in the project scanstart/place.js
    • CivilCraft
    64-bit
  • Inverse placement

    The transform from project coordinates back to pixels.

    det = g₁·g₅ − g₂·g₄; inverse = adjugate ÷ det

    Placing a scanned sheet in the project scanstart/place.js
    • CivilCraft
    64-bit
  • Scale of a placement

    The project units per pixel a placement stands for, reported with every fit.

    scale = √|g₁·g₅ − g₂·g₄|

    Placing a scanned sheet in the project scanstart/place.js
    • CivilCraft
    64-bit
  • Rotation of a placement

    The angle a placement turns the sheet by, in degrees.

    rotation = atan2(g₄, g₁) × 180 ÷ π

    Placing a scanned sheet in the project scanstart/place.js
    • CivilCraft
    64-bit
  • 3 × 3 linear solve

    Solves the normal equations of the affine fit.

    Gauss-Jordan elimination with partial pivoting

    Placing a scanned sheet in the project scanstart/place.js
    • CivilCraft
    64-bit
  • Least-squares fit to matched points

    The placement that best matches points picked on the scan to their project coordinates, with each point's residual and the root mean square.

    similarity: c = Σ(u·X + v·Y) ÷ Σ(u² + v²), d = Σ(u·Y − v·X) ÷ Σ(u² + v²); rms = √(Σ r² ÷ n)

    Placing a scanned sheet in the project scanstart/place.js
    • CivilCraft
    64-bit
  • Traced arc to points

    Turns an arc found on the scan into points for a line layer.

    n = max(2, ⌈|sweep| ÷ 5°⌉); point = center + r·(cos t, sin t)

    Placing a scanned sheet in the project scanstart/place.js
    • CivilCraft
    64-bit
  • Traced lines in project coordinates

    The lines and arcs traced on the scan as one line layer in project coordinates.

    each end point through the placement; kept when its length > the minimum

    Placing a scanned sheet in the project scanstart/place.js
    • CivilCraft
    64-bit
  • Frame of a member

    The origin, the unit direction, the two section axes and the length of a member line.

    x = (e − s) ÷ |e − s|; v = unit(Z − x·x_z); u = v × x; u′ = cos a·u + sin a·v, v′ = −sin a·u + cos a·v

    Member frames and local coordinates geom.js
    • DetailCraft
    64-bit
  • Local point to model point

    The model coordinates of a point given along the member and across its section.

    p = o + x·x̂ + u·û + (v + voff)·v̂

    Member frames and local coordinates geom.js
    • DetailCraft
    64-bit
  • Model point to local point

    Where a model point lies along a member and across its section.

    d = p − o; x = d·x̂, u = d·û, v = d·v̂ − voff

    Member frames and local coordinates geom.js
    • DetailCraft
    64-bit
  • End face position on a plane-cut end

    How far along the part its end face is at a given point of the section, for square ends and mitre cuts.

    x = x0 + ku·u + kv·v

    Member frames and local coordinates geom.js
    • DetailCraft
    64-bit
  • Section outline clipped at a height

    The part of a section outline below or above a line, used for coped ends.

    t = (limit − a_v) ÷ (b_v − a_v); new point = (a_u + (b_u − a_u)·t, limit)

    Member frames and local coordinates geom.js
    • DetailCraft
    64-bit
  • Distance from a point to a member line

    The shortest distance from a point to the segment between a member's two ends.

    k = clamp((P − a)·(b − a) ÷ |b − a|², 0, 1); d = |P − (a + k·(b − a))|

    Finding joints between members connections.js
    • DetailCraft
    64-bit
  • Is a member vertical

    Whether a member stands vertical, the condition for a column to take a connection.

    |Δx| < 1 mm and |Δy| < 1 mm and |Δz| ≥ 1 mm

    Finding joints between members connections.js
    • DetailCraft
    64-bit
  • Members end to end in line

    Pairs of member ends that meet in line, with the gap between them.

    along = d·d̂_a; off = |d − d̂_a·along|; in line when |d̂_a·d̂_b| ≥ 0.9999, off ≤ 1 mm, |d| ≤ 50 mm

    Finding joints between members connections.js
    • DetailCraft
    64-bit
  • Beam end at a column

    Which beam ends land on a column, and whether they meet its flange, its web or come in skewed.

    flange when |away·v̂| > 0.9999; web when |away·û| > 0.9999; else skew

    Finding joints between members connections.js
    • DetailCraft
    64-bit
  • Members meeting at an angle

    Pairs of I-shaped member ends that share a point and are not in line, with the angle between them.

    angle = acos(clamp(ê_A·ê_B, −1, 1)) × 180 ÷ π

    Finding joints between members connections.js
    • DetailCraft
    64-bit
  • Steel and bar weight in the status line

    The total weight of all steel parts and of all reinforcing bars, shown under the drawing.

    steel = Σ part weight; bars = Σ row total weight

    Weight totals in the status line and panels detailcraft.js
    • DetailCraft
    64-bit
  • Steel weight of a selection

    The weight of the selected members plus the main plate of each selected connection.

    steel = Σ weight of selected members and connection plates

    Weight totals in the status line and panels detailcraft.js
    • DetailCraft
    64-bit
  • Cut length and weight of one part

    The cut length, weight and weight per meter shown for a selected member.

    Weight totals in the status line and panels detailcraft.js
    • DetailCraft
    64-bit
  • Numbers in the model file

    How the model's numbers are written to the file.

    The model file and what it stores model.js
    • DetailCraft
    64-bit
  • A point of a member

    Checks and stores a member's start or end point.

    The model file and what it stores model.js
    • DetailCraft
    64-bit
  • Member rotation and minimum length

    Brings a member's rotation into 0 to 360 degrees and refuses a member shorter than 1 mm.

    rotation = ((r mod 360) + 360) mod 360; length = √(Δx² + Δy² + Δz²) ≥ 1 mm

    The model file and what it stores model.js
    • DetailCraft
    64-bit
  • Grid lines from spacings

    The position of each grid line from the list of spacings typed.

    at_i = at_{i−1} + spacing_{i−1}

    The model file and what it stores model.js
    • DetailCraft
    64-bit
  • Spacings shown for existing grid lines

    The spacings text filled into the grid dialog from the stored grid positions.

    spacing = (at_i − at_{i−1}) to 3 decimals

    The model file and what it stores model.js
    • DetailCraft
    64-bit
  • A loose bolt as stored

    The diameter, length, head point and direction kept for a bolt that is not part of a connection.

    d, length, head: round(v × 1000) ÷ 1000; axis_i = round(a_i ÷ |a| × 10⁶) ÷ 10⁶

    The model file and what it stores model.js
    • DetailCraft
    64-bit
  • Viewport scale from 1:n

    Paper units per model unit for a drawing scale 1:n.

    s = mm per model unit ÷ mm per paper unit ÷ n

    Paper sizes, drawing scales and viewport aim sheets.js
    • CadCraft
    64-bit
  • Scale 1:n from a viewport scale

    The n of 1:n that a viewport's stored scale stands for.

    n = mm per model unit ÷ mm per paper unit ÷ s

    Paper sizes, drawing scales and viewport aim sheets.js
    • CadCraft
    64-bit
  • List of standard and custom scales

    The scales offered for a drawing: the standard ones and the drawing's own that the standard list lacks.

    custom n = drawing ÷ paper; kept when |n − listed n| ≥ 1e-6 × n for every listed scale

    Paper sizes, drawing scales and viewport aim sheets.js
    • CadCraft
    64-bit
  • Name of a viewport scale

    The text a viewport scale reads as: a standard name when it is one, else 1:n.

    Paper sizes, drawing scales and viewport aim sheets.js
    • CadCraft
    64-bit
  • Ratio text for a scale that is not listed

    Writes 1:n or n:1 for a scale with no standard name.

    n ≥ 1: "1:n"; n < 1: "(1 ÷ n):1"

    Paper sizes, drawing scales and viewport aim sheets.js
    • CadCraft
    64-bit
  • Largest standard scale that fits

    Picks the largest listed scale at which the window still fits the viewport.

    largest s with s ≤ sFit × (1 + 1e-9)

    Paper sizes, drawing scales and viewport aim sheets.js
    • CadCraft
    64-bit
  • Viewport center and scale for a model window

    The model point a viewport looks at and the scale at which a model window fits it.

    sFit = min(w ÷ Δx, h ÷ Δy); center = ((minX + maxX) ÷ 2, (minY + maxY) ÷ 2)

    Paper sizes, drawing scales and viewport aim sheets.js
    • CadCraft
    64-bit
  • Standard paper for a sheet size

    Finds the standard paper a sheet of w × h is, either way round.

    |standard side − side| ≤ 0.005 × side, both sides in mm

    Paper sizes, drawing scales and viewport aim sheets.js
    • CadCraft
    64-bit
  • Space for viewports on a sheet

    The rectangle inside the border and above the title block, in paper units.

    x0 = sheet x0 + 15 mm × k; y0 = sheet y0 + 47 mm × k; x1 = sheet x0 + (W − 15 mm) × k; y1 = sheet y0 + (H − 15 mm) × k; k = 1 ÷ mm per paper unit

    Paper sizes, drawing scales and viewport aim sheets.js
    • CadCraft
    64-bit
  • Viewport of a new sheet

    The size, paper position, model center and scale of the viewport a new sheet starts with.

    Paper sizes, drawing scales and viewport aim sheets.js
    • CadCraft
    64-bit
  • Clusters of the model

    Groups the model's visible objects whose bounding boxes are within a gap of each other, and returns each group's box.

    Automatic sheet layout autosheet.js
    • CadCraft
    64-bit
  • Gap that separates parts

    The distance below which two objects count as one part.

    gap = max(Δx, Δy, 1e-9) × 0.04

    Automatic sheet layout autosheet.js
    • CadCraft
    64-bit
  • Size of a part's viewport at a scale

    The paper width and height a part needs at a scale 1:n, with padding and a caption band.

    w = Δx × s + 2 × 4 mm × k; h = Δy × s + 2 × 4 mm × k + 7 mm × k; k = 1 ÷ mm per paper unit

    Automatic sheet layout autosheet.js
    • CadCraft
    64-bit
  • Shelf packing

    Places boxes in rows inside the free zone and returns each box's lower-left corner, or nothing when they do not fit.

    Automatic sheet layout autosheet.js
    • CadCraft
    64-bit
  • Scale and place for every part on one paper

    Chooses the scale or scales and the position of each viewport on a given paper.

    Automatic sheet layout autosheet.js
    • CadCraft
    64-bit
  • Scale on automatic paper

    With no scale given and automatic paper, the scale the largest part gets on the default paper.

    Automatic sheet layout autosheet.js
    • CadCraft
    64-bit
  • Viewport placed for a part

    The viewport stored for each part: paper size and center, model center and scale.

    h = packed h − 7 mm × k; paper center = (x + w ÷ 2, y + 7 mm × k + h ÷ 2); model center = midpoint of the window

    Automatic sheet layout autosheet.js
    • CadCraft
    64-bit
  • Frame a sheet maps onto

    The drawing area a redline sheet is mapped onto: a given box, or the extents of everything drawn.

    Redline items placed in the drawing redline.js
    • CadCraft
    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.