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

  • Crossover between parallel tracks

    The straight between two turnouts that join parallel tracks, and the overall length.

    straight = (spacing − 2g) ÷ sin θ; length = 2 × lead + straight × cos θ

    Railway turnouts, crossovers and clearance envelopes turnout.js
    • CivilCraft
    64-bit
  • Speed on the diverging route

    The speed for a radius, cant and cant deficiency.

    V = √(R·(E + D) ÷ (rail ÷ 127.12)) km/h; rail = 1500 mm gives 11.8

    Railway turnouts, crossovers and clearance envelopes turnout.js
    • CivilCraft
    64-bit
  • Vehicle throw on a curve

    How far the middle of a vehicle moves in and its ends move out on a curve.

    inside = b² ÷ (8R); outside = (L² − b²) ÷ (8R)

    Railway turnouts, crossovers and clearance envelopes turnout.js
    • CivilCraft
    64-bit
  • Clearance outline on a canted curve

    The vehicle or structure outline tilted by the cant and widened by the curve throw.

    tilt = asin(min(1, cant ÷ base)); rotate each point about the low rail; shift by the inside or outside throw

    Railway turnouts, crossovers and clearance envelopes turnout.js
    • CivilCraft
    64-bit
  • Least track spacing for two outlines

    The smallest center spacing at which two clearance outlines do not overlap.

    bisection on the shift between 0 and 20, 60 halvings

    Railway turnouts, crossovers and clearance envelopes turnout.js
    • CivilCraft
    64-bit
  • Turn angle at a junction

    The angle a main turns through at a junction of two pipes.

    turn = |atan2 of the leg after − atan2 of the leg before|, folded to 0 to 180 degrees

    Water mains as objects: depths, fittings and take-off water-objects.js
    • CivilCraft
    64-bit
  • Pipe depths and derived fittings

    The elevation of each pipe end, the position of placed objects along pipes, and the fittings the layout implies.

    z = ground − cover; on a pipe: p = a + (b − a)·t; length = stated, else √(Δx² + Δy²); bend angle rounded to 0.1°

    Water mains as objects: depths, fittings and take-off water-objects.js
    • CivilCraft
    64-bit
  • Take-off of pipes and fittings

    The count of each fitting by kind and size and the count and total length of pipe by size.

    length per size = Σ pipe lengths

    Water mains as objects: depths, fittings and take-off water-objects.js
    • CivilCraft
    64-bit
  • Take-off as CSV

    Writes the take-off list to a CSV file.

    length = round(length × 100) ÷ 100; size to 1 decimal

    Water mains as objects: depths, fittings and take-off water-objects.js
    • CivilCraft
    64-bit
  • Ground elevation of a new node

    The elevation stored on a junction, reservoir or tank when it is placed on the plan.

    z = round(ground × 100) ÷ 100; reservoir head = z + 30 (m) or 100 (ft)

    Water mains as objects: depths, fittings and take-off water-ui.js
    • CivilCraft
    64-bit
  • Signed polygon area

    The signed area of a closed outline.

    A = −½ Σ (xⱼ + xᵢ)(yⱼ − yᵢ)

    Outline minus holes: area and boundary lengths landscape/areas.js
    • CivilCraft
    64-bit
  • Point inside a polygon

    Whether a point lies inside an outline, used to keep or drop each boundary piece.

    count edges with (aᵧ > y) ≠ (bᵧ > y) and x < x on the edge at height y

    Outline minus holes: area and boundary lengths landscape/areas.js
    • CivilCraft
    64-bit
  • Where two segments cross

    The position along one edge where another edge crosses or touches it.

    t = ((c − a) × s) ÷ (r × s); u = ((c − a) × r) ÷ (r × s)

    Outline minus holes: area and boundary lengths landscape/areas.js
    • CivilCraft
    64-bit
  • Area by slabs

    The area of the outline with every hole removed, overlaps counted once.

    area = Σ over slabs of (width inside the outline and outside all holes at mid-height) × slab height

    Outline minus holes: area and boundary lengths landscape/areas.js
    • CivilCraft
    64-bit
  • Outline and cut lengths

    The pieces of the outline that remain and the pieces of the holes that cut it, with their total lengths.

    length = Σ |b − a| over kept pieces; a = e.a + t₀(e.b − e.a), b = e.a + t₁(e.b − e.a)

    Outline minus holes: area and boundary lengths landscape/areas.js
    • CivilCraft
    64-bit
  • Meters per project unit

    The length of one project unit in meters, used by every landscape calculation that works in meters.

    1 ft = 1200 ÷ 3937 m (US survey foot); 1 m = 1

    Planting: bed and hedge fills, planted areas and their quantities landscape/planting.js
    • CivilCraft
    Exact
  • Bed area

    The plan area of a bed outline.

    A = |Σ (xⱼ + xᵢ)(yⱼ − yᵢ)| ÷ 2

    Planting: bed and hedge fills, planted areas and their quantities landscape/planting.js
    • CivilCraft
    64-bit
  • Whole plant counts from percentages

    Splits a number of plants among species so the counts add up to exactly that number.

    count = ⌊pct ÷ Σpct × n⌋, then the leftover goes to the largest remainders

    Planting: bed and hedge fills, planted areas and their quantities landscape/planting.js
    • CivilCraft
    64-bit
  • Spacing from the plant list

    The spacing a bed or hedge is filled at when none is typed: the species' spacings weighted by their share.

    s = Σ (pct × spacing) ÷ Σ pct

    Planting: bed and hedge fills, planted areas and their quantities landscape/planting.js
    • CivilCraft
    64-bit
  • Plants in a bed

    The position of every plant in a bed at the given spacing and pattern, and the count per species.

    grid step s, row pitch s (square) or s·√3 ÷ 2 (triangular); keep when inside and at least s ÷ 2 − 1e-9 from the edge

    Planting: bed and hedge fills, planted areas and their quantities landscape/planting.js
    • CivilCraft
    64-bit
  • Plants along a hedge

    The number and positions of plants along a hedge line in one or two rows.

    n = ⌊length ÷ s + 1e-9⌋ + 1; first plant at (length − (n − 1)·s) ÷ 2

    Planting: bed and hedge fills, planted areas and their quantities landscape/planting.js
    • CivilCraft
    64-bit
  • Offset of an open line

    A line moved sideways by a distance with mitred corners, used for hedge and path edges, obstacle footprints and IFC bodies.

    corner = p + m × d ÷ max(0.25, m·n₁), m = normalized sum of the two edge normals

    Planting: bed and hedge fills, planted areas and their quantities landscape/planting.js
    • CivilCraft
    64-bit
  • Default build-up depths

    The topsoil and mulch depths a new planted area starts with, in project units.

    feet = round(meters ÷ 0.3048 × 100) ÷ 100

    Planting: bed and hedge fills, planted areas and their quantities landscape/planted.js
    • CivilCraft
    64-bit
  • Plants in a clipped planted area

    The plants of a planted area after paving, walls and steps are cut out of it.

    keep when inside what is left and at least s ÷ 2 − 1e-9 from a cut edge

    Planting: bed and hedge fills, planted areas and their quantities landscape/planted.js
    • CivilCraft
    64-bit
  • Planted area quantities

    The net area, perimeter, edging length, topsoil and mulch volumes and plant count of a planted area.

    topsoil = net area × topsoil depth; mulch = net area × mulch depth; edging = outline length left after clipping

    Planting: bed and hedge fills, planted areas and their quantities landscape/planted.js
    • CivilCraft
    64-bit
  • Planted area quantities for takeoff

    The area, topsoil, mulch, membrane and edging quantities passed to TakeoffCraft.

    qty = round(v × 100) ÷ 100; cubic yards = cubic feet ÷ 27

    Planting: bed and hedge fills, planted areas and their quantities landscape/planted.js
    • CivilCraft
    64-bit
  • Formula evaluation

    The value of a parsed formula for one row.

    + − × ÷ % ^ in 64-bit; round(x, d) = round(x × 10ᵈ) ÷ 10ᵈ

    Worksheets: formulas, column rounding and totals landscape/worksheet.js
    • CivilCraft
    64-bit
  • Numbers to and from text inside a formula

    How a value is read as a number, and how a number is written when it is joined into text.

    text of a number = round(v × 10⁹) ÷ 10⁹

    Worksheets: formulas, column rounding and totals landscape/worksheet.js
    • CivilCraft
    64-bit
  • Rounding a cell to its column's decimals

    Applies the column's decimals setting to a cell.

    cell = Number(v.toFixed(dec))

    Worksheets: formulas, column rounding and totals landscape/worksheet.js
    • CivilCraft
    64-bit
  • Sum, count, average, minimum and maximum

    The total of a column over a group or the whole worksheet.

    sum = Σ cells; average = Σ cells ÷ n

    Worksheets: formulas, column rounding and totals landscape/worksheet.js
    • CivilCraft
    64-bit
  • Rows, groups, subtotals and totals

    Builds the worksheet's rows from the objects, grouped and sorted, with subtotals and a total line.

    Worksheets: formulas, column rounding and totals landscape/worksheet.js
    • CivilCraft
    64-bit
  • Route length

    The plan length of a cable route in project units.

    L = Σ √(Δx² + Δy²)

    Underground cable routes: cover, crossings, joints and trench quantities powerline/underground.js
    • CivilCraft
    64-bit
  • Cover and cable band of a trench

    The cover over the cable and the thickness of the band the cable or its ducts occupy, in meters.

    cover = trench cover, or max(0, depth − bedding − band); band = duct diameter, or cable diameter

    Underground cable routes: cover, crossings, joints and trench quantities powerline/underground.js
    • CivilCraft
    64-bit
  • Cable profile and cover check

    The ground and the top of the cable along the route, and whether the cover meets the minimum.

    cable = ground − cover ÷ m per unit; samples every L ÷ 100 by default

    Underground cable routes: cover, crossings, joints and trench quantities powerline/underground.js
    • CivilCraft
    64-bit
  • Crossing of two plan segments

    Where two straight segments cross in plan, as a position along each.

    t = ((p − a) × e) ÷ (d × e); u = ((p − a) × d) ÷ (d × e)

    Underground cable routes: cover, crossings, joints and trench quantities powerline/underground.js
    • CivilCraft
    64-bit
  • Crossings along the route

    Every place a segment crosses the route, with its chainage.

    ch = chainage of the vertex before + t × segment length

    Underground cable routes: cover, crossings, joints and trench quantities powerline/underground.js
    • CivilCraft
    64-bit
  • Separation from a pipe at a crossing

    The clear vertical gap between the cable and a pipe where they cross.

    invert = (inv up + (inv down − inv up)·u) × m per unit; pipe top = invert + diameter; cable top = ground − cover; gap = max(cable bottom − pipe top, invert − cable top)

    Underground cable routes: cover, crossings, joints and trench quantities powerline/underground.js
    • CivilCraft
    64-bit
  • Separation from another cable route

    The clear vertical gap between two cable routes that cross, each at its own cover under the same ground.

    gap between [−cover A − band A, −cover A] and [−cover B − band B, −cover B]

    Underground cable routes: cover, crossings, joints and trench quantities powerline/underground.js
    • CivilCraft
    64-bit
  • Cables and pipes under an overhead line

    The cable routes and pipes an overhead line crosses in plan, with the line's chainage and the level of the top of each.

    cable top = ground − cover ÷ m per unit; pipe top = invert at the crossing + diameter

    Underground cable routes: cover, crossings, joints and trench quantities powerline/underground.js
    • CivilCraft
    64-bit
  • Joints from the drum length

    How many joints each cable needs and where along the route they fall.

    run = length × (1 + slack %); joints per cable = ⌈run ÷ drum⌉ − 1; at = k × drum ÷ (1 + slack %)

    Underground cable routes: cover, crossings, joints and trench quantities powerline/underground.js
    • CivilCraft
    64-bit
  • Trench quantities

    Trench length, excavation, bedding and backfill volumes, duct length and cable length of a route.

    excavation = width × depth × length; bedding = width × bedding × length; backfill = excavation − bedding − ducts × π(d ÷ 2)² × length; cable = (length × slack + 2 × depth) × count

    Underground cable routes: cover, crossings, joints and trench quantities powerline/underground.js
    • CivilCraft
    64-bit
  • Cubic meters per cubic yard

    The factor used to give volumes in cubic yards in a feet project.

    1 yd³ = 0.764554857984 m³

    Power line tables, quantities and GIS export powerline/outputs.js
    • CivilCraft
    Exact
  • Stringing table rows

    Tension, span length, sag and conductor length per section and temperature, in project units.

    length ÷ m per unit; force ÷ 10 for daN or ÷ 4.4482216152605 for lbf

    Power line tables, quantities and GIS export powerline/outputs.js
    • CivilCraft
    64-bit
  • Stringing table CSV

    The stringing table as CSV text.

    lengths and sags round(v, 2); tension round(v, 1)

    Power line tables, quantities and GIS export powerline/outputs.js
    • CivilCraft
    64-bit
  • Support table rows

    Ground, attachment, load, nominal load, foundation and swing per support, in project units.

    attach height = attach z − ground z; load = worst F_eq in daN or lbf

    Power line tables, quantities and GIS export powerline/outputs.js
    • CivilCraft
    64-bit
  • Conductor length to buy

    The conductor length of a line with an allowance for jumpers and waste.

    length = Σ catenary lengths × phases × circuits × 1.02 ÷ m per unit

    Power line tables, quantities and GIS export powerline/outputs.js
    • CivilCraft
    64-bit
  • Lengths and volumes in project units

    Converts meters and cubic meters to feet and cubic yards for the quantity rows.

    LF = m ÷ 0.3048; CY = m³ ÷ 0.764554857984

    Power line tables, quantities and GIS export powerline/outputs.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.