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

  • Sun azimuth and altitude

    The sun's direction and height above the horizon at a moment and a place.

    JD = ms ÷ 86 400 000 + 2 440 587.5; T = (JD − 2 451 545) ÷ 36 525; cos Z = sin φ·sin δ + cos φ·cos δ·cos H

    Sun position drive.js
    • CivilCraft
    64-bit
  • Atmospheric refraction

    The lift of the sun's apparent altitude by the atmosphere, added to the geometric altitude.

    h > 5°: 58.1 ÷ tan h − 0.07 ÷ tan³h + 0.000086 ÷ tan⁵h seconds of arc

    Sun position drive.js
    • CivilCraft
    64-bit
  • Unit vector toward the sun

    The sun's direction as east, north and up components.

    (cos h·sin a, cos h·cos a, sin h)

    Sun position drive.js
    • CivilCraft
    64-bit
  • Ground samples inside the area

    A grid of ground elevations inside the polygon, each standing for one cell of ground.

    cell = √(bounding box area ÷ 20 000) unless given

    Earthwork balance and haul plan earthwork.js
    • CivilCraft
    64-bit
  • Cut and fill volumes

    Cut, fill, usable cut and the net at a design level.

    fill = area × Σ max(design − ground, 0); cut = area × Σ max(ground − design, 0); net = cut × factor − fill

    Earthwork balance and haul plan earthwork.js
    • CivilCraft
    64-bit
  • Balanced level

    The design level at which usable cut equals fill.

    Earthwork balance and haul plan earthwork.js
    • CivilCraft
    64-bit
  • Design plane

    The design elevation at a point for a level and two grades.

    z = z₀ + gx·(x − cx) + gy·(y − cy)

    Earthwork balance and haul plan earthwork.js
    • CivilCraft
    64-bit
  • Free-haul moment

    The volume moved times the distance between the centroid of cut and the centroid of fill.

    moment = min(cut × factor, fill) × |centroid(cut) − centroid(fill)|

    Earthwork balance and haul plan earthwork.js
    • CivilCraft
    64-bit
  • Best tilt

    The level and tilt, within the grade limit, that balance with the least haul moment.

    Earthwork balance and haul plan earthwork.js
    • CivilCraft
    64-bit
  • Blocks of cut and fill

    Cells grouped into blocks, each with its volume and its volume-weighted center.

    center = Σ (p × v) ÷ Σ v

    Earthwork balance and haul plan earthwork.js
    • CivilCraft
    64-bit
  • Minimum-cost transport

    How much goes from each block of cut to each block of fill at the least total volume times distance.

    Earthwork balance and haul plan earthwork.js
    • CivilCraft
    64-bit
  • Haul plan totals

    Volume moved on site, total haul, average haul distance, and what is left to take away or bring in.

    haul = Σ volume × distance; average = haul ÷ moved

    Earthwork balance and haul plan earthwork.js
    • CivilCraft
    64-bit
  • Earthwork balancer run

    The volumes at the pad's present level, the balanced level, the tilt and the haul plan for one pad.

    factor = 1 + percent ÷ 100; cell area = cell²

    Earthwork, route and pond tools: values stored and exported eg-ui.js
    • CivilCraft
    64-bit
  • Balanced level written to the pad

    The pad's level, and its corner elevations when it tilts, as stored in the project.

    z stored = Number(z.toFixed(3))

    Earthwork, route and pond tools: values stored and exported eg-ui.js
    • CivilCraft
    64-bit
  • Haul plan CSV

    The haul flows exported as a CSV file.

    Earthwork, route and pond tools: values stored and exported eg-ui.js
    • CivilCraft
    64-bit
  • Alignment from a found route

    The PIs of a new alignment from the route's points, with a curve radius at each bend.

    r = min(R, min(l₁, l₂) ÷ (2·tan(Δ/2))), stored to 2 decimals

    Earthwork, route and pond tools: values stored and exported eg-ui.js
    • CivilCraft
    64-bit
  • Route ends picked in the plan

    The start and end of a route search as taken from two picked points.

    x, y = Number(v.toFixed(3))

    Earthwork, route and pond tools: values stored and exported eg-ui.js
    • CivilCraft
    64-bit
  • Sized orifice written to the pond

    The orifice diameter found for the target outflow, as stored in the pond.

    diameter stored = Number((d ÷ L).toFixed(3))

    Earthwork, route and pond tools: values stored and exported eg-ui.js
    • CivilCraft
    64-bit
  • Pond hydrograph CSV

    Inflow, outflow and stage against time exported as a CSV file.

    Earthwork, route and pond tools: values stored and exported eg-ui.js
    • CivilCraft
    64-bit
  • Survey points for progress checks

    Ground points read from a LAS, LAZ, CSV or text file and turned into a surface.

    LAS thinning cell = max(0.5, √(extent area ÷ 400 000)) unless a spacing is given

    Earthwork, route and pond tools: values stored and exported eg-ui.js
    • CivilCraft
    64-bit
  • Three-decimal rounding of tool results

    The rounding applied to nearly every number a tool returns to an assistant or script.

    r3(v) = round(v × 1000) ÷ 1000

    Earthwork, route and pond tools: values stored and exported eg-agent.js
    • CivilCraft
    64-bit
  • Volumes in report units

    Volumes converted to cubic yards or cubic meters for a tool's answer.

    cubic yards = cubic feet ÷ 27; from cubic meters: ÷ 0.028316846592 ÷ 27

    Earthwork, route and pond tools: values stored and exported eg-agent.js
    • CivilCraft
    64-bit
  • Rain results in inches and cubic feet per second

    Depths and flows from the rain solver converted from meters for a feet project.

    inches = meters × 39.3700787; ft³/s = m³/s ÷ 0.028316846592

    Earthwork, route and pond tools: values stored and exported eg-agent.js
    • CivilCraft
    64-bit
  • Pad level set by an assistant

    A pad's level and, for a tilted pad, its corner elevations, as stored in the project.

    z stored = r3(level); corner z = r3(level + gx·(x − cx) + gy·(y − cy))

    Earthwork, route and pond tools: values stored and exported eg-agent.js
    • CivilCraft
    64-bit
  • Alignment from route points

    The PIs of an alignment made by an assistant from route points, with curve radii.

    r = min(R, min(l₁, l₂) ÷ (2·tan(Δ/2))), stored to 3 decimals

    Earthwork, route and pond tools: values stored and exported eg-agent.js
    • CivilCraft
    64-bit
  • Orifice sized by an assistant

    The orifice diameter found for an allowed outflow, as used for the reported run.

    diameter = r3(d ÷ L)

    Earthwork, route and pond tools: values stored and exported eg-agent.js
    • CivilCraft
    64-bit
  • Arc from two points and a bulge

    The center, radius, start angle, sweep and length of the arc between two vertices.

    k = (1 − b²) ÷ (4b); center = chord middle + k·(−Δy, Δx); r = c·(1 + b²) ÷ (4|b|); sweep = 4·atan(b); L = r·|sweep|

    Feature line grades, arcs, offsets and crossings featureline.js
    • CivilCraft
    64-bit
  • Bulge of an arc through three points

    The bulge of the arc drawn from a start, through a middle point, to an end.

    sweep = 2·(π − angle at the middle point); bulge = sign × tan(sweep ÷ 4)

    Feature line grades, arcs, offsets and crossings featureline.js
    • CivilCraft
    64-bit
  • Bulge for a typed radius

    The bulge of the shorter arc of a given radius between two vertices.

    Δ = 2·asin(c ÷ 2r); bulge = ±tan(Δ ÷ 4)

    Feature line grades, arcs, offsets and crossings featureline.js
    • CivilCraft
    64-bit
  • Point and direction along a segment

    The plan point and travel direction at a fraction of a straight or arc segment.

    arc: p = c + r·(cos θ, sin θ), θ = a₀ + sweep × u

    Feature line grades, arcs, offsets and crossings featureline.js
    • CivilCraft
    64-bit
  • Segment lengths and grades

    Each segment's plan length, chord, 3D length, rise and grade.

    length = chord or r·|sweep|; 3D length = √(L² + Δz²); grade = Δz ÷ L

    Feature line grades, arcs, offsets and crossings featureline.js
    • CivilCraft
    64-bit
  • Stations along a feature line

    The plan distance from the start to each vertex.

    Feature line grades, arcs, offsets and crossings featureline.js
    • CivilCraft
    64-bit
  • Elevation from a grade

    The far vertex of a segment moved to the elevation a typed grade gives.

    z₂ = z₁ + grade × length

    Feature line grades, arcs, offsets and crossings featureline.js
    • CivilCraft
    64-bit
  • One grade between two vertices

    The vertices between two chosen ones placed on a single grade.

    z = z₀ + (z₁ − z₀) × (s − s₀) ÷ L

    Feature line grades, arcs, offsets and crossings featureline.js
    • CivilCraft
    64-bit
  • Stepped offset

    A copy of the line moved sideways with mitred corners and raised by a height or a cross slope.

    corner shift = bisector × d ÷ cos(half angle); z + Δz, or z + |d| × slope

    Feature line grades, arcs, offsets and crossings featureline.js
    • CivilCraft
    64-bit
  • Straight segment against an alignment element

    Where a straight feature line segment crosses a line or arc of the alignment, with the station.

    line: 2×2 solve by cross products; arc: A·t² + B·t + C = 0, t = (−B ± √(B² − 4AC)) ÷ 2A

    Feature line grades, arcs, offsets and crossings featureline.js
    • CivilCraft
    64-bit
  • Arc segment against an alignment element

    Where an arc of a feature line crosses a line or arc of the alignment.

    two circles: along = (r₁² − r₂² + d²) ÷ 2d; h = √(r₁² − along²)

    Feature line grades, arcs, offsets and crossings featureline.js
    • CivilCraft
    64-bit
  • Feature line read from a file

    The vertices kept when a feature line is read from a project file or a drawing.

    Feature line grades, arcs, offsets and crossings featureline.js
    • CivilCraft
    64-bit
  • Elevations of a newly drawn line

    The elevation each vertex of a new feature line gets.

    Feature line grades, arcs, offsets and crossings features-ui.js
    • CivilCraft
    64-bit
  • Elevation and grade boxes

    A typed vertex elevation or segment grade applied to the line.

    grade = typed percent ÷ 100

    Feature line grades, arcs, offsets and crossings features-ui.js
    • CivilCraft
    64-bit
  • Offset distance and amount

    The typed offset distance and height or slope passed to the stepped offset.

    slope = typed percent ÷ 100

    Feature line grades, arcs, offsets and crossings features-ui.js
    • CivilCraft
    64-bit
  • Number of pieces for an arc

    How many straight pieces draw an arc within the tolerance.

    step = min(2·acos(1 − tol ÷ r), 5°); pieces = ⌈|sweep| ÷ step⌉, from 1 to 720

    Feature line arcs as straight pieces featureline.js
    • CivilCraft
    64-bit
  • Line as straight pieces

    The feature line with every arc replaced by vertices on the arc.

    p = c + r·(cos θ, sin θ), θ = a₀ + sweep × s ÷ k; z = z_a + (z_b − z_a) × s ÷ k

    Feature line arcs as straight pieces featureline.js
    • CivilCraft
    64-bit
  • Closed design line as a grading item

    The outline and the single elevation a closed design feature line passes to grading.

    z = Σ vertex z ÷ number of vertices

    Feature line arcs as straight pieces featureline.js
    • CivilCraft
    64-bit
  • Feature line written to DWG or DXF

    The 3D polyline and the extended data that records which runs of pieces were arcs.

    Feature line arcs as straight pieces featureline.js
    • CivilCraft
    64-bit
  • Feature line read back from DWG or DXF

    The feature line rebuilt from a polyline and its extended data.

    Feature line arcs as straight pieces featureline.js
    • CivilCraft
    64-bit
  • Crossings with an alignment

    Every place a feature line crosses the centerline, with its station and elevation.

    z = z_a + t × Δz

    Feature line arcs as straight pieces featureline.js
    • CivilCraft
    64-bit
  • Stretches running beside an alignment

    The parts of a feature line within a given distance of the centerline, as station and elevation for a profile view.

    Feature line arcs as straight pieces featureline.js
    • CivilCraft
    64-bit
  • Project units to meters

    The factor that takes a project length to meters for every engine in this file.

    feet: 0.3048; meters: 1

    Running saved geotechnical, survey, pit and link items geo-run.js
    • CivilCraft
    64-bit
  • Soil profile along a section

    The borings in meters, the layers between them, and the layer stack at evenly spaced stations.

    stations = max(2, round(length ÷ step)), default step = max(length ÷ 40, 0.5 m)

    Running saved geotechnical, survey, pit and link items geo-run.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.