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

  • Module DC power

    The power of one module at a given irradiance and cell temperature.

    P = Wp × G ÷ 1000 × (1 + γ × (T_cell − 25))

    Solar yield estimate pv-yield.js
    • BimCraft
    • CivilCraft
    64-bit
  • Loss chain

    The share of the DC energy left after soiling, mismatch, wiring, downtime and the inverter.

    chain = (1 − soiling) × (1 − mismatch) × (1 − wiring) × (1 − availability) × inverter efficiency

    Solar yield estimate pv-yield.js
    • BimCraft
    • CivilCraft
    64-bit
  • Power in one hour

    The light on the array, the cell temperature and the DC and AC power for one hour of a month's representative day.

    G = beam × (1 − shade) + sky + ground; P = n × max(0, module power); AC before clipping = P ÷ 1000 × chain

    Solar yield estimate pv-yield.js
    • BimCraft
    • CivilCraft
    64-bit
  • Monthly figures

    A month's light, shade loss and DC energy from its representative day.

    month = day × days in month; shade loss % = (unshaded − shaded) ÷ unshaded × 100

    Solar yield estimate pv-yield.js
    • BimCraft
    • CivilCraft
    64-bit
  • Inverter clipping and monthly AC energy

    The AC energy of each month after the inverter's rating limits the hourly power.

    scale = P_ac ÷ Σ P when Σ P > P_ac; month AC = Σₕ P × scale × days, rounded to 0.1 kWh

    Solar yield estimate pv-yield.js
    • BimCraft
    • CivilCraft
    64-bit
  • Annual energy, specific yield and performance ratio of an array

    An array's yearly DC and AC energy, kWh per kWp and performance ratio.

    AC = Σ rounded months; specific yield = AC ÷ kWp; PR = AC ÷ (kWp × POA)

    Solar yield estimate pv-yield.js
    • BimCraft
    • CivilCraft
    64-bit
  • Plant totals

    The energy, specific yield, performance ratio, clipping and shade loss of all arrays together.

    PR = Σ AC ÷ Σ(kWp × POA); clipped % = clipped ÷ unclipped × 100

    Solar yield estimate pv-yield.js
    • BimCraft
    • CivilCraft
    64-bit
  • Mesh handed to the solid kernel

    Welds the mesh's corners and passes it to manifold-3d.

    weld grid = 10⁻⁶ × max(Δx, Δy, Δz); positions → Float32Array

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part
  • Boolean of two solids

    The difference, union or intersection of two element meshes.

    c = center of a's box; R = (a − c) OP (b − c); result = R + c

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part
  • Element minus all its openings

    Subtracts every opening from an element, one after another.

    A₀ = base − c; Aᵢ = Aᵢ₋₁ − (cutterᵢ − c); result = Aₙ + c

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part
  • Face planes of a convex cutter

    Finds the outward planes of a cutter and decides whether it is convex.

    n = (b − a) × (c − a) ÷ |…|; d = n · a; convex when n · p − d ≤ 10 ε for every corner p

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Polygon split by a plane

    Cuts a convex polygon into the part in front of a plane and the part behind it.

    t = dₐ ÷ (dₐ − d_b); x = a + (b − a) t

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Mesh clipped by a plane

    Keeps the part of a mesh on one side of a plane and closes the cut.

    dᵢ = (pᵢ − p) · n; ε = 10⁻⁹ × (d_max − d_min); cut point = a + (b − a) dₐ ÷ (dₐ − d_b)

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Cap of a cut

    Joins the cut segments into loops, sorts outer loops from holes and fills them.

    key = round(x ÷ tol), round(y ÷ tol), round(z ÷ tol); area = ½ |Σ (xᵢ yᵢ₊₁ − xᵢ₊₁ yᵢ)|

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Half-space cut

    Removes the part of an element behind a plane, optionally only inside a polygon boundary.

    L = 4 × max(1, box diagonal) + |P₀ − box min|; prism height = 2 L

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part
  • Vertex data of one geometry

    Returns a geometry's positions and normals for drawing and for measuring.

    IFC geometry handed to the apps ifc/api.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part
  • Placement matrix of each piece

    The matrix that takes a geometry's vertices to model space in meters, Y up.

    M = C × Y-up × scale(u) × placement

    IFC geometry handed to the apps ifc/api.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Shift to the origin

    Finds the translation that brings the model near the origin.

    c = (box min + box max) ÷ 2 of the first element; C = translate(−(Y-up × scale(u) × placement × c))

    IFC geometry handed to the apps ifc/api.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • File units to meters, Z up to Y up

    Scales a placement by the file's length unit and turns its axes.

    M′ = Y-up × scale(u) × M

    IFC geometry handed to the apps ifc/api.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Unit sizes in meters

    The length of a meter, a foot and a US survey foot used for elevations.

    ft = 0.3048 m; US survey ft = 1200 ÷ 3937 m

    GIS import: reprojection and elevation units gis-read.js
    • CivilCraft
    Exact
  • Features placed in the project

    Reprojects every vertex of every layer and scales its elevation.

    z′ = z × (source unit in m ÷ project unit in m)

    GIS import: reprojection and elevation units gis-read.js
    • CivilCraft
    64-bit
  • Middle of the data in longitude and latitude

    Finds where the imported data lies, to suggest a coordinate system near it.

    c = (min + max) ÷ 2 of the bounding box

    GIS import: reprojection and elevation units gis-read.js
    • CivilCraft
    64-bit
  • Survey points given as latitude and longitude

    Converts point-file rows in degrees to project coordinates.

    GIS import: reprojection and elevation units gis-read.js
    • CivilCraft
    64-bit
  • Default thresholds

    The heights the filter uses when the caller gives none.

    h₀ = 0.3 × cell; h_max = 6 × cell; low noise = slope × cell × 3 + 3 × h₀

    Ground points from an unclassified point cloud ground-classify.js
    • CivilCraft
    64-bit
  • Lowest point per cell

    Sorts the points into grid cells and keeps the lowest of each.

    column = ⌊(x − minₓ) ÷ cell⌋; row = ⌊(y − min_y) ÷ cell⌋

    Ground points from an unclassified point cloud ground-classify.js
    • CivilCraft
    64-bit
  • Stray low points

    Drops single points that lie far below their neighbors.

    stray when median(neighbors) − z > low-noise limit

    Ground points from an unclassified point cloud ground-classify.js
    • CivilCraft
    64-bit
  • Opening with growing windows

    Marks cells that stand above the opened surface as objects, round by round.

    wₖ = 2ᵏ + 1; dhₖ = min(h_max, slope × (wₖ − wₖ₋₁) × cell + h₀); object when z − opened > dhₖ

    Ground points from an unclassified point cloud ground-classify.js
    • CivilCraft
    64-bit
  • Morphological opening

    The minimum, then the maximum, over a square window around each cell.

    Ground points from an unclassified point cloud ground-classify.js
    • CivilCraft
    64-bit
  • Coordinates read from a row

    Takes the northing, easting and elevation of one line of a point file.

    Survey point files: reading and writing points.js
    • CivilCraft
    64-bit
  • Points written as a PNEZD file

    Writes point number, northing, easting, elevation and description, comma separated.

    N, E and Z written with dec decimals (3 by default)

    Survey point files: reading and writing points.js
    • CivilCraft
    64-bit
  • Point count per group

    Counts the points of each description group.

    Survey point files: reading and writing points.js
    • CivilCraft
    Exact
  • Grades and vertical curves

    Builds the grades between PVIs and the curve at each interior PVI.

    g = Δz ÷ Δsta; A = (g₂ − g₁) × 100; L = K × |A|; z_BVC = z_PVI − g₁ × L ÷ 2; x_high/low = −g₁ × L ÷ (g₂ − g₁)

    Vertical profile: grades and parabolic curves profile.js
    • CivilCraft
    64-bit
  • Design elevation at a station

    The profile's elevation at any station.

    z = z_BVC + g₁ × x + (g₂ − g₁) × x² ÷ (2L), x = sta − BVC; on a tangent z = zᵢ + g × (sta − staᵢ)

    Vertical profile: grades and parabolic curves profile.js
    • CivilCraft
    64-bit
  • Grade at a station

    The profile's slope at any station.

    g = g₁ + (g₂ − g₁) × (sta − BVC) ÷ L

    Vertical profile: grades and parabolic curves profile.js
    • CivilCraft
    64-bit
  • Existing ground along the alignment

    Samples the surface's elevation at regular stations and at the alignment's key stations.

    step = length ÷ 1000, at least 0.5; stations: start, start + step, …, end, plus key stations

    Vertical profile: grades and parabolic curves profile.js
    • CivilCraft
    64-bit
  • Stand-in ground for a road with no survey

    The elevation and extent of the flat ground a corridor is drawn on when the project has no surface.

    z = mean of the PVI elevations, rounded to 0.01; margin = (60 m or 200 ft) + 6 × (z_max − z_min)

    Project: stand-in ground, volumes and saved points project.js
    • CivilCraft
    64-bit
  • Cut and fill inside the daylight lines

    The total cut and fill and the figures per graded item.

    Project: stand-in ground, volumes and saved points project.js
    • CivilCraft
    64-bit
  • Points in the project file

    Writes each survey point to the .civilcraft.json file.

    Project: stand-in ground, volumes and saved points project.js
    • CivilCraft
    64-bit
  • Default rate table

    The rates by radius and the relative gradient a new corridor starts with.

    Superelevation: runoff, runout and lane slopes superelev.js
    • CivilCraft
    64-bit
  • Rate for a radius

    Looks up the superelevation rate of a curve.

    Superelevation: runoff, runout and lane slopes superelev.js
    • CivilCraft
    64-bit
  • Runoff, runout and transition stations

    The lengths and stations of the transition into and out of each curve.

    L_r = lane × e ÷ Δ; L_t = (NC ÷ e) × L_r; without a spiral: level at TS − ⅔L_r, full at TS + ⅓L_r

    Superelevation: runoff, runout and lane slopes superelev.js
    • CivilCraft
    64-bit
  • Outside lane slope through a transition

    The cross slope of the outside lane at a station.

    runout: NC − NC × (x − nc₀) ÷ L_t; runoff: −e × (x − lc₀) ÷ L_r; result = max(up, down, −e)

    Superelevation: runoff, runout and lane slopes superelev.js
    • CivilCraft
    64-bit
  • Lane slopes at a station

    The fall-away slope of the left and right lanes.

    inside = max(NC, −outside)

    Superelevation: runoff, runout and lane slopes superelev.js
    • CivilCraft
    64-bit
  • Line taken from the team

    Turns shared geometry into feature line points in the drawing's unit.

    k = 1 (same unit), 0.3048 (ft → m) or 1 ÷ 0.3048 (m → ft); p′ = p × k

    Shared feature lines: units and geometry team-lines.js
    • CivilCraft
    64-bit
  • Line sent to the team

    Turns a feature line into the points that are shared.

    Shared feature lines: units and geometry team-lines.js
    • CivilCraft
    64-bit
  • One point into its cell

    Decides whether an incoming point is kept, replaces the cell's point, or is dropped.

    i = ⌊(x − oₓ) ÷ cell⌋; key = i × 2³² + (j + 2³¹); nearest: d² = (fₓ − i − ½)² + (f_y − j − ½)²

    Thinning point clouds to a spacing thin.js
    • CivilCraft
    64-bit
  • The thinned points

    Returns one point per occupied cell.

    average mode: x̄ = Σx ÷ n, ȳ = Σy ÷ n, z̄ = Σz ÷ n

    Thinning point clouds to a spacing thin.js
    • CivilCraft
    64-bit
  • Grid step for a spacing

    How many grid nodes to skip so an elevation grid is thinned to about the spacing asked for.

    n = max(1, round(spacing ÷ cell size))

    Thinning point clouds to a spacing thin.js
    • CivilCraft
    64-bit
  • Estimate of points kept

    Tells the import dialog about how many points a thinning will keep.

    kept ≈ Σ min(points × f, cell area × f ÷ spacing² + 1), f = part of the coarse cell inside the area

    Thinning point clouds to a spacing thin.js
    • CivilCraft
    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

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.