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

  • Layer elevations

    The top and bottom elevation and the thickness of each layer of a boring.

    top = z − from; bottom = z − to; thickness = to − from

    Boring logs and the soil profile between borings geotech.js
    • CivilCraft
    64-bit
  • SPT blow count corrections

    N60 and (N1)60 from a field blow count.

    N60 = N × ER ÷ 60 × CB × CS × CR; CN = min(1.7, √(101.325 ÷ σ′v)); (N1)60 = CN × N60

    Boring logs and the soil profile between borings geotech.js
    • CivilCraft
    64-bit
  • Boring projected onto the section line

    The station along the section and the offset from it of a boring.

    t = ((p − a)·(b − a)) ÷ |b − a|², clamped to 0…1; station = length so far + t·|b − a|

    Boring logs and the soil profile between borings geotech.js
    • CivilCraft
    64-bit
  • Soil profile between borings

    The polygon of each soil unit between neighboring borings, the ground line and the water line.

    pinch-out point = ((s₁ + s₂) ÷ 2, (top + bottom) ÷ 2)

    Boring logs and the soil profile between borings geotech.js
    • CivilCraft
    64-bit
  • Layer stack at a station

    The top and bottom of every soil unit at one station of the profile.

    z = z_a + (s − s_a) ÷ (s_c − s_a) × (z_c − z_a)

    Boring logs and the soil profile between borings geotech.js
    • CivilCraft
    64-bit
  • Signed area of a ring

    The area of a ring, positive when it runs counter-clockwise.

    area = Σ (xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ) ÷ 2

    GIS feature geometry gis-geom.js
    • CivilCraft
    64-bit
  • Point inside a ring

    Whether a point lies inside a ring.

    GIS feature geometry gis-geom.js
    • CivilCraft
    64-bit
  • Rings sorted into polygons and holes

    Which rings are outlines and which are holes, and which outline each hole belongs to.

    GIS feature geometry gis-geom.js
    • CivilCraft
    64-bit
  • Coordinates through a conversion

    Every vertex of a geometry passed through a function of x and y, keeping z.

    GIS feature geometry gis-geom.js
    • CivilCraft
    64-bit
  • Elevations through a conversion

    The z of every vertex passed through a function, for unit conversion.

    GIS feature geometry gis-geom.js
    • CivilCraft
    64-bit
  • Layers moved to a new coordinate system

    Every GIS layer's coordinates converted when the project's system changes.

    project → grid of the old system → grid of the new system → project

    GIS feature geometry gis-layers.js
    • CivilCraft
    64-bit
  • Attribute value as a label

    The text drawn on the plan for a feature's attribute value.

    number shown = +v.toFixed(3)

    GIS feature geometry gis-layers.js
    • CivilCraft
    64-bit
  • Label point of a polygon

    The centroid of a polygon's largest ring, where its label is placed.

    cx = Σ (xᵢ + xᵢ₊₁)·cᵢ ÷ (3·Σ cᵢ), cᵢ = xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ

    GIS feature geometry gis-layers.js
    • CivilCraft
    64-bit
  • Project units per file unit

    The factor that turns a spacing typed in project units into the file's own units.

    k = |f(c + d) − f(c)| ÷ d, c = middle of the file

    Terrain import and GeoTIFF export settings gis-terrain-ui.js
    • CivilCraft
    64-bit
  • Default thinning spacing

    The spacing the dialog proposes so the import stays under the point limit.

    grid: cell × ⌈√(n ÷ (0.98 × cap))⌉; LiDAR: max(1.5 × √(area ÷ points), 1.1 × √(area ÷ cap)) rounded to a 1-2-5 step

    Terrain import and GeoTIFF export settings gis-terrain-ui.js
    • CivilCraft
    64-bit
  • Points a grid import will make

    The number of cells read and of points or triangles made, shown before the import runs.

    count = ⌈columns ÷ step⌉ × ⌈rows ÷ step⌉; triangles = 2 × (⌈columns ÷ step⌉ − 1) × (⌈rows ÷ step⌉ − 1)

    Terrain import and GeoTIFF export settings gis-terrain-ui.js
    • CivilCraft
    64-bit
  • LiDAR point into project coordinates

    Each kept LiDAR point's position and elevation as stored in the project.

    (x, y) → f(x, y); z → z × z factor

    Terrain import and GeoTIFF export settings gis-terrain-ui.js
    • CivilCraft
    64-bit
  • Default GeoTIFF cell size

    The cell size proposed when a surface is exported as an elevation grid.

    cell = average triangle edge ÷ 2.5, rounded to a 1-2-5 step

    Terrain import and GeoTIFF export settings gis-terrain-ui.js
    • CivilCraft
    64-bit
  • GeoTIFF grid size estimate

    The number of columns and rows the dialog says the export will have.

    nx = ⌈width ÷ cell⌉ + 1; ny = ⌈height ÷ cell⌉ + 1

    Terrain import and GeoTIFF export settings gis-terrain-ui.js
    • CivilCraft
    64-bit
  • Lengths, bearings, grades and area

    Every number the Measure tool shows for a picked line or shape.

    L = hypot(Δx, Δy); bearing = atan2(Δy, Δx); grade % = Δz ÷ L × 100; L₃ = hypot(L, Δz); area = |Σ (x_i·y_j − x_j·y_i)| ÷ 2

    Measure tool measure.js
    • CivilCraft
    64-bit
  • Between two points on a profile

    The horizontal distance, height difference, straight-line distance and grade between two profile points.

    dx = |ch_b − ch_a|; dz = z_b − z_a; slope distance = hypot(dx, dz); grade % = dz ÷ dx × 100

    Measure tool measure.js
    • CivilCraft
    64-bit
  • Angle from degrees, minutes and seconds

    Reads an angle typed as degrees, minutes and seconds or as decimal degrees.

    degrees = d + m ÷ 60 + s ÷ 3600

    Parcels: deed calls, closure, area and legal description parcels.js
    • CivilCraft
    64-bit
  • Bearing to direction

    Turns a quadrant bearing or an azimuth into a direction in radians from east, counter-clockwise.

    direction = (90° − azimuth) × π ÷ 180, wrapped to 0…2π

    Parcels: deed calls, closure, area and legal description parcels.js
    • CivilCraft
    64-bit
  • Central angle of a curve call

    The central angle of a deed curve from its arc length, or as typed.

    Δ = L ÷ R

    Parcels: deed calls, closure, area and legal description parcels.js
    • CivilCraft
    64-bit
  • Traverse and misclosure

    The corners reached by the calls, the gap back to the start, the total length and the precision ratio.

    p ← p + d·(cos θ, sin θ); chord = 2R·sin(Δ ÷ 2); misclosure = |end − start|; precision = length ÷ misclosure

    Parcels: deed calls, closure, area and legal description parcels.js
    • CivilCraft
    64-bit
  • Curve from a bulge

    The radius, length, central angle, chord, tangent directions and center of a curved course.

    Δ = 4·atan|b|; R = chord ÷ (2·sin(Δ ÷ 2)); L = R × Δ; center = start + R·(cos, sin)(dir_in ± 90°)

    Parcels: deed calls, closure, area and legal description parcels.js
    • CivilCraft
    64-bit
  • Courses of a parcel

    Each side of the parcel as a line (direction and distance) or a curve.

    direction = atan2(Δy, Δx); distance = hypot(Δx, Δy)

    Parcels: deed calls, closure, area and legal description parcels.js
    • CivilCraft
    64-bit
  • Parcel area

    The area of the parcel, with curved sides counted exactly.

    2A = Σ (x_i·y_j − x_j·y_i) + Σ ± R²·(Δ − sin Δ); area = |2A| ÷ 2

    Parcels: deed calls, closure, area and legal description parcels.js
    • CivilCraft
    64-bit
  • Perimeter

    The length round the parcel.

    perimeter = Σ line distances + Σ curve lengths

    Parcels: deed calls, closure, area and legal description parcels.js
    • CivilCraft
    64-bit
  • Area in words

    The area as square units with acres or hectares.

    acres = sq ft ÷ 43560; hectares = sq m ÷ 10000

    Parcels: deed calls, closure, area and legal description parcels.js
    • CivilCraft
    64-bit
  • Course and area labels

    The bearing and distance text along each side and the area text at the middle.

    Parcels: deed calls, closure, area and legal description parcels.js
    • CivilCraft
    64-bit
  • Bulge from a typed radius

    Turns a radius typed for one side of a parcel into the stored curve.

    bulge = ± tan(asin(chord ÷ 2R) ÷ 2)

    Parcels: deed calls, closure, area and legal description parcels-ui.js
    • CivilCraft
    64-bit
  • Does the traverse close

    Decides whether typed deed calls return to the start, in which case the last point is dropped and the parcel closes on its first corner.

    closes when misclosure ≤ 0.0005 × max(1, length ÷ 1000)

    Parcels: deed calls, closure, area and legal description parcels-ui.js
    • CivilCraft
    64-bit
  • Gravity and Manning constant per unit system

    The gravity and the Manning equation constant every river calculation uses.

    m: k = 1, g = 9.80665; ft: k = 1.486, g = 32.174

    River model: stations, cut sections and reach lengths river.js
    • CivilCraft
    64-bit
  • River station of a point

    The station of a point, measured along the centerline from its downstream end, and its offset to the side.

    rs = L − d

    River model: stations, cut sections and reach lengths river.js
    • CivilCraft
    64-bit
  • Cross-section from a cut line

    Turns a line drawn across the river into a cross-section: station, ground points by offset, and first bank positions.

    rs = round₆(L − d_crossing); o = round₆(offset); banks = lowest point ± bank distance, clipped to the section

    River model: stations, cut sections and reach lengths river.js
    • CivilCraft
    64-bit
  • Sections at a spacing along the centerline

    Cuts square cross-sections every set distance along the centerline and at both ends.

    dₖ = k × spacing while k × spacing < L − 1e-9; rs = round₆(L − dₖ)

    River model: stations, cut sections and reach lengths river.js
    • CivilCraft
    64-bit
  • Reach lengths between sections

    The channel and overbank distances from each section to the next one downstream.

    channel = rsᵢ − rsᵢ₋₁; overbank = √(Δx² + Δy²) between the middles of the overbank parts of the two cut lines

    River model: stations, cut sections and reach lengths river.js
    • CivilCraft
    64-bit
  • Flow at a station

    The flow that applies at a station, from the profile's flow and its flow changes.

    River model: stations, cut sections and reach lengths river.js
    • CivilCraft
    64-bit
  • First guess of the boundary slope

    The slope offered for a normal-depth boundary when one is first chosen, from the lowest points of the end sections.

    S = (z_min upstream − z_min downstream) ÷ (rs upstream − rs downstream), to 3 significant digits; 0.001 when S ≤ 1e-5

    River model: stations, cut sections and reach lengths river-ui.js
    • CivilCraft
    64-bit
  • Sample stations

    The stations where sections are cut: every multiple of the step, both ends, the curve ends and any extra stations.

    sta = round₆(k × step) for whole k; neighbors closer than 1e-6 merged

    Cross sections and end-area volumes along an alignment sections.js
    • CivilCraft
    64-bit
  • Sample line at a station

    The two ends of the line square to the alignment at a station.

    right = (sin dir, −cos dir); a = c − right × left; b = c + right × right offset

    Cross sections and end-area volumes along an alignment sections.js
    • CivilCraft
    64-bit
  • Surface along a sample line

    The ground or design line along a sample line, with a point at every triangle edge it crosses.

    z at a + (b − a)·t for every edge-crossing parameter t; o = offA + (offB − offA)·t

    Cross sections and end-area volumes along an alignment sections.js
    • CivilCraft
    64-bit
  • Segment crossing parameter

    Where one segment crosses another, as a fraction along the first.

    den = r × s; t = ((q − p) × s) ÷ den; u = ((q − p) × r) ÷ den

    Cross sections and end-area volumes along an alignment sections.js
    • CivilCraft
    64-bit
  • Elevation of a section line at an offset

    The elevation of a section at any offset, between its points.

    z = z₀ + (z₁ − z₀)·(o − o₀) ÷ (o₁ − o₀)

    Cross sections and end-area volumes along an alignment sections.js
    • CivilCraft
    64-bit
  • Cut and fill area of a section

    The area of cut and of fill between the ground line and the design line of one section.

    per interval: area = (e₀ + e₁) ÷ 2 × w; where the lines cross: o× = o₀ + w·e₀ ÷ (e₀ − e₁), two triangles

    Cross sections and end-area volumes along an alignment sections.js
    • CivilCraft
    64-bit
  • Feature line crossings

    The offset and elevation where each corridor feature line crosses the sample line.

    o = −left + (left + right)·t; z = z_p + (z_q − z_p)·u

    Cross sections and end-area volumes along an alignment sections.js
    • CivilCraft
    64-bit
  • Spans inside the graded regions

    The parts of a sample line that lie inside the graded regions, which is where the design counts.

    Cross sections and end-area volumes along an alignment sections.js
    • CivilCraft
    64-bit
  • Volumes between sections

    Cut and fill volume between neighboring sections and the running totals.

    V = (A₁ + A₂) ÷ 2 × (sta₂ − sta₁); cumulative = Σ V

    Cross sections and end-area volumes along an alignment sections.js
    • CivilCraft
    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.