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

  • Values in the shared problem list

    The found and required values attached to a failed concrete check or drift.

    utilization rounded to 0.0001; drift rounded to 0.01 mm

    Numbers in the frame analysis report frame/frame-concrete.js
    • CadCraft
    • BimCraft
    • DetailCraft
    64-bit
  • Slab and wall rows of the report

    For each slab or wall: its largest deflection, its largest positive and negative moments, twisting moment and shear.

    max and min of the plates' center values; Q = √(Qx² + Qy²); w = largest node displacement; kN·m/m = N·mm/mm ÷ 1000, 2 decimals

    Numbers in the frame analysis report frame/plate-draw.js
    • CadCraft
    • BimCraft
    • DetailCraft
    64-bit
  • Values in a slab problem

    The required and provided steel, or the shear and its strength, attached to a failed slab check.

    steel rounded to 0.1 mm²/m; shear to 0.1 kN/m

    Numbers in the frame analysis report frame/slab-design.js
    • CadCraft
    • BimCraft
    • DetailCraft
    64-bit
  • Deflected shape

    The members' deflected shape, enlarged so it can be seen.

    drawn point = point + scale × displacement; scale = 0.015 × model size ÷ largest displacement

    Analysis results drawn on the model frame/frame-draw.js
    • CadCraft
    • BimCraft
    • DetailCraft
    32-bit, display only
  • Force diagram beside a member

    A filled diagram of one internal force drawn square to each member, with its largest value labeled.

    height = value × 0.08 × model size ÷ largest value

    Analysis results drawn on the model frame/frame-draw.js
    • CadCraft
    • BimCraft
    • DetailCraft
    32-bit, display only
  • Plate contours

    Each plate as two triangles colored by its corner values, with the largest values labeled.

    color = ramp(|value| ÷ largest |value|); kN·m/m = N·mm/mm ÷ 1000

    Analysis results drawn on the model frame/plate-draw.js
    • CadCraft
    • BimCraft
    • DetailCraft
    32-bit, display only
  • Points written to a file

    Each point's northing, easting and elevation as text.

    text = v.toFixed(3); 0 when |v| < 0.0005

    Layout point files and as-built comparison layout/layout-points.js
    • CadCraft
    • BimCraft
    64-bit
  • Points read from a file

    Turns the northing, easting and elevation text of a row into numbers.

    x = Number(E); y = Number(N); z = Number(Z) or none

    Layout point files and as-built comparison layout/layout-points.js
    • CadCraft
    • BimCraft
    64-bit
  • Difference between a design and an as-built point

    The offsets in x, y and height, the horizontal and 3D distance, and whether the point is within tolerance.

    dh = √(dx² + dy²); d3 = √(dh² + dz²); out when dh > tol or |dz| > tolZ

    Layout point files and as-built comparison layout/layout-points.js
    • CadCraft
    • BimCraft
    64-bit
  • Matching points by nearness

    Pairs each design point with the closest unused as-built point within a radius.

    pairs sorted by horizontal distance, taken closest first; radius = 10 × tol by default

    Layout point files and as-built comparison layout/layout-points.js
    • CadCraft
    • BimCraft
    64-bit
  • Summary of the comparison

    The counts, the largest horizontal and height differences and the root mean square of the horizontal differences.

    rms = √(Σ dh² ÷ n)

    Layout point files and as-built comparison layout/layout-points.js
    • CadCraft
    • BimCraft
    64-bit
  • Comparison table

    The rows of the comparison as text for the page and the CSV.

    text = v.toFixed(3)

    Layout point files and as-built comparison layout/layout-points.js
    • CadCraft
    • BimCraft
    64-bit
  • Day of the year

    The day number of a date.

    N = days before the month + day (+1 after February in a leap year)

    Sun position for shadows m3d/sun.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    Exact
  • Equation of time and declination

    How far sun time runs ahead of clock time, and the sun's angle above the equator, for the date.

    γ = 2π ÷ (365 or 366) × (N − 1 + (hour − 12) ÷ 24); eqtime = 229.18 × (0.000075 + 0.001868 cos γ − 0.032077 sin γ − 0.014615 cos 2γ − 0.040849 sin 2γ)

    Sun position for shadows m3d/sun.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Hour angle and altitude

    The sun's height above the horizon.

    tst = hour × 60 + eqtime + 4 × lon − 60 × tz; H = tst ÷ 4 − 180°; cos Z = sin φ sin δ + cos φ cos δ cos H; altitude = 90° − Z

    Sun position for shadows m3d/sun.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Azimuth

    The sun's compass direction, in degrees clockwise from north.

    azimuth = atan2(sin H, cos H sin φ − tan δ cos φ) + 180°, wrapped to 0…360

    Sun position for shadows m3d/sun.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Direction toward the sun

    The unit vector shadows are cast from, in model axes (north is +Y, east is +X).

    dir = (sin a cos alt, cos a cos alt, sin alt)

    Sun position for shadows m3d/sun.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Unit vector

    A vector scaled to length 1.

    n = a ÷ |a|; [0, 0, 0] when |a| ≤ 1e-15

    3D vectors, planes and transforms m3d/vec.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    64-bit
  • Polygon normal

    The unit normal of a polygon given by its corner points.

    N = Σ (pᵢ − pᵢ₊₁) × (pᵢ + pᵢ₊₁) taken per axis, then normalized

    3D vectors, planes and transforms m3d/vec.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    64-bit
  • Polygon area in 3D

    The area of a flat polygon in space.

    area = |Σ (pᵢ − pᵢ₊₁) × (pᵢ + pᵢ₊₁)| ÷ 2

    3D vectors, planes and transforms m3d/vec.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    64-bit
  • Plane through a point

    A plane as a unit normal and an offset, with the normal's sign made canonical.

    n·p = d; first component of n with |n| > 1e-9 is made positive

    3D vectors, planes and transforms m3d/vec.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    64-bit
  • Same plane test

    Whether two planes are the same plane.

    |n₁·n₂| > 1 − 1e-9 and |d₁ × sign(n₁·n₂) − d₂| ≤ 1e-6

    3D vectors, planes and transforms m3d/vec.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    64-bit
  • Closest points of a line and a segment

    The nearest points between a ray's line and an edge.

    den = (d·d)(u·u) − (d·u)²; t = (B·E − C·D) ÷ den; s = (A·E − B·D) ÷ den, clamped to [0, 1]

    3D vectors, planes and transforms m3d/vec.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    64-bit
  • Closest points of two lines

    The nearest points between two infinite lines, or nothing when they are parallel.

    den = A·C − B²; parallel when |den| < 1e-14 × A × C

    3D vectors, planes and transforms m3d/vec.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    64-bit
  • Ray and plane

    The point where a ray's line meets a plane.

    t = (d_plane − n·o) ÷ (n·dir); p = o + t × dir

    3D vectors, planes and transforms m3d/vec.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    64-bit
  • Ray and triangle

    The distance along a ray to a triangle, or nothing when it misses.

    Möller–Trumbore: det = e₁·(d × e₂); u, v, t from three scalar triple products ÷ det

    3D vectors, planes and transforms m3d/vec.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    64-bit
  • Rotation about an axis through a point

    The 4×4 matrix that turns geometry by an angle about an axis through a given point.

    M = T(about) × R(axis, θ) × T(−about), R from Rodrigues' formula

    3D vectors, planes and transforms m3d/vec.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    64-bit
  • Transform a point

    A point moved by a 4×4 matrix.

    p′ = (M × [x, y, z, 1]) ÷ w

    3D vectors, planes and transforms m3d/vec.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    64-bit
  • Inverse of a 4×4 matrix

    The matrix that undoes a transform, used to move points into a group's own coordinates.

    M⁻¹ = adj(M) ÷ det(M), with det from twelve 2×2 minors

    3D vectors, planes and transforms m3d/vec.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    64-bit
  • Unit constants

    The Boltzmann constant, Coulomb constant, acceleration factor and pressure factor for reduced and real units.

    real: kB = 0.0019872041 kcal/mol/K; ke = 332.0637; accel = 418.4; pressure = 68568.4 atm per kcal/mol/ų

    Molecular dynamics molecular/md.js
    • CadCraft
    • BimCraft
    64-bit
  • Complementary error function

    erfc(x), used for the real-space part of the Ewald sum.

    erfc(x) ≈ t × exp(−x² + P₉(t)), t = 1 ÷ (1 + |x| ÷ 2); 2 − that for x < 0

    Molecular dynamics molecular/md.js
    • CadCraft
    • BimCraft
    64-bit
  • Pair parameters and the cutoff shift

    σ and ε for each pair of atom types and the energy subtracted so the pair energy is zero at the cutoff.

    σᵢⱼ = (σᵢ + σⱼ) ÷ 2; εᵢⱼ = √(εᵢ εⱼ); shift = 4 εᵢⱼ (s² − s), s = (σᵢⱼ ÷ r_c)⁶

    Molecular dynamics molecular/md.js
    • CadCraft
    • BimCraft
    64-bit
  • Kinetic energy

    The kinetic energy of the system in its energy unit.

    KE = ½ Σ mᵢ (vx² + vy² + vz²) ÷ accel

    Molecular dynamics molecular/md.js
    • CadCraft
    • BimCraft
    64-bit
  • Temperature

    The instantaneous temperature from the kinetic energy.

    T = 2 KE ÷ (dof × kB), dof = max(1, 3N − 3 − constraints)

    Molecular dynamics molecular/md.js
    • CadCraft
    • BimCraft
    64-bit
  • Pair forces and energies

    The Lennard-Jones and real-space Coulomb force, energy and virial of one pair of atoms.

    U = 4ε(s⁶² − s⁶) − shift, s⁶ = (σ² ÷ r²)³; Coulomb: ke qᵢqⱼ erfc(αr) ÷ r; excluded pairs: −ke qᵢqⱼ erf(αr) ÷ r

    Molecular dynamics molecular/md.js
    • CadCraft
    • BimCraft
    64-bit
  • Bond stretch

    The energy, force and virial of each harmonic bond.

    U = ½ k (r − r₀)²; F = −k (r − r₀) ÷ r along the bond

    Molecular dynamics molecular/md.js
    • CadCraft
    • BimCraft
    64-bit
  • Bond angles

    The energy, forces and virial of each harmonic angle.

    θ = acos(a·b ÷ (|a||b|)); U = ½ k (θ − θ₀)²; dU/dcos = −k (θ − θ₀) ÷ sin θ

    Molecular dynamics molecular/md.js
    • CadCraft
    • BimCraft
    64-bit
  • Dihedral angles

    The energy and forces of each periodic dihedral.

    φ = atan2(|b₂| b₁·n₂, n₁·n₂); U = k_d (1 + cos(nφ − δ))

    Molecular dynamics molecular/md.js
    • CadCraft
    • BimCraft
    64-bit
  • Ewald reciprocal sum and self term

    The long-range part of the Coulomb energy and force.

    E = (2π ke ÷ V) Σ_k exp(−k² ÷ 4α²) ÷ k² × |S(k)|², |n|² ≤ kmax²; self = −ke α ÷ √π × Σ q²

    Molecular dynamics molecular/md.js
    • CadCraft
    • BimCraft
    64-bit
  • Pressure

    The virial pressure of the box.

    P = (2 KE + W) ÷ (3V) × unit factor

    Molecular dynamics molecular/md.js
    • CadCraft
    • BimCraft
    64-bit
  • Time stepping, thermostats and barostat

    Advances the system by velocity Verlet, with optional temperature and pressure coupling.

    v += ½ dt a; x += dt v; forces; v += ½ dt a; Berendsen λ = √(1 + dt÷τ (T₀÷T − 1)); μ = ∛(max(0.5, 1 − dt÷τ_p κ (P₀ − P)))

    Molecular dynamics molecular/md.js
    • CadCraft
    • BimCraft
    64-bit
  • Radial distribution function

    g(r): how many atoms sit at each distance, relative to an ideal gas of the same density.

    g(b) = count(b) ÷ (frames × shell × N_A × (N_B, or N_A − 1 for one type) ÷ V), shell = 4⁄3 π ((b+1)³ − b³) dr³

    Molecular dynamics molecular/md.js
    • CadCraft
    • BimCraft
    64-bit
  • Mean-square displacement and diffusion

    The mean-square displacement over time and the diffusion coefficient from its slope.

    D = (n Σtm − Σt Σm) ÷ (n Σt² − (Σt)²) ÷ 6 over the chosen part of the samples

    Molecular dynamics molecular/md.js
    • CadCraft
    • BimCraft
    64-bit
  • Mass density

    The density of the box in g/cm³ (real units).

    ρ = Σm ÷ 0.602214076 ÷ V (amu per ų to g/cm³)

    Molecular dynamics molecular/md.js
    • CadCraft
    • BimCraft
    64-bit
  • Fast Fourier transform

    The in-place radix-2 transform used on each axis of the charge mesh.

    Molecular dynamics molecular/pme.js
    • CadCraft
    • BimCraft
    64-bit
  • Cardinal B-spline

    The weight of a charge on a mesh point.

    M₂(u) = 1 − |u − 1|; Mₙ(u) = u ÷ (n−1) × Mₙ₋₁(u) + (n−u) ÷ (n−1) × Mₙ₋₁(u−1)

    Molecular dynamics molecular/pme.js
    • CadCraft
    • BimCraft
    64-bit
  • B-spline moduli

    The correction 1 ÷ |b(m)|² applied to each mesh wave vector.

    Molecular dynamics molecular/pme.js
    • CadCraft
    • BimCraft
    64-bit
  • Particle-mesh Ewald energy and forces

    The reciprocal Coulomb energy and the force on every charge from a mesh instead of the plain sum.

    E = ½ Σ_m G(m) |Q̂(m)|², G = ke ÷ (πV) × exp(−π² m² ÷ α²) ÷ m² × B(m)

    Molecular dynamics molecular/pme.js
    • CadCraft
    • BimCraft
    64-bit
  • Rigid bonds

    Moves atoms after a step so each constrained bond has its set length, and corrects the velocities.

    g = (d² − r²) ÷ (2 (1÷mᵢ + 1÷mⱼ) r·s); stop when |d² − r²| ≤ 2 × tol × d²

    Molecular dynamics molecular/pme.js
    • CadCraft
    • BimCraft
    64-bit
  • Mean and standard error of a run

    The mean of the samples and its standard error by block averaging.

    mean = Σx ÷ n; error = √(Σ(blockᵢ − m)² ÷ (nb − 1) ÷ nb), nb = min(5, n) blocks of ⌊n ÷ nb⌋ samples

    Molecular dynamics molecular/props.js
    • CadCraft
    • BimCraft
    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.