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

  • Lot outline with arcs as chords

    The lot as a counter-clockwise ring of points, each tagged with the lot line it starts.

    chord angle = 2·acos(1 − 0.01 ÷ R); n = ⌈Δ ÷ chord angle⌉, 2 ≤ n ≤ 400

    Zoning envelope and limit checks zoning.js
    • CivilCraft
    64-bit
  • Setback distance for each lot line

    Assigns the front, side or rear distance, or a typed distance, to every lot line, and picks the rear line when none is named.

    rear = the line with −cos(dir − front dir) > 0.5 whose midpoint is farthest from the front line's midpoint

    Zoning envelope and limit checks zoning.js
    • CivilCraft
    64-bit
  • Buildable envelope and its area

    The lot taken in from every line by that line's setback, with its area, or the reason it cannot be built.

    area = |shoelace(envelope)|; lot area = |shoelace(lot ring)|

    Zoning envelope and limit checks zoning.js
    • CivilCraft
    64-bit
  • Mitred inset with a distance per line

    Moves each lot line in by its own distance and finds each new corner where two moved lines meet.

    s = ((q − p) × u_q) ÷ (u_p × u_q); corner = p + s·u_p

    Zoning envelope and limit checks zoning.js
    • CivilCraft
    64-bit
  • Allowed height under a sky-exposure plane

    The lowest height the cap and the sky-exposure plane allow over a footprint.

    s = ((p − a) × (b − a)) ÷ |b − a|; h = h₀ + rise × max(0, s); allowed = min over corners and lines

    Zoning envelope and limit checks zoning.js
    • CivilCraft
    64-bit
  • Footprint area inside the envelope

    How much of a building footprint lies inside the buildable envelope.

    area = Σ over envelope triangles of |shoelace(footprint clipped to the triangle)|

    Zoning envelope and limit checks zoning.js
    • CivilCraft
    64-bit
  • Clip a footprint to one triangle

    The part of a polygon inside a convex, counter-clockwise piece.

    side(p) = (b − a) × (p − a); crossing at u = s_p ÷ (s_p − s_q)

    Zoning envelope and limit checks zoning.js
    • CivilCraft
    64-bit
  • Coverage, floor area ratio, setback and height checks

    Compares the masses on a lot with every limit typed for it and lists each result.

    coverage = Σ footprint ÷ lot area; FAR = Σ floor area ÷ lot area; outside = footprint − inside area

    Zoning envelope and limit checks zoning.js
    • CivilCraft
    64-bit
  • STL reader

    Turns a binary or ASCII STL file into a mesh with shared vertices, scaled to millimeters.

    Freeform mesh objects: quantities and placement on the ground landscape/freeform.js
    • CivilCraft
    64-bit
  • Volume, surface area, footprint and height

    The quantities of a mesh object that schedules and the IFC export report.

    V = |Σ v₀·(v₁×v₂)| ÷ 6; A = Σ |(v₁−v₀)×(v₂−v₀)| ÷ 2; height = z max − z min

    Freeform mesh objects: quantities and placement on the ground landscape/freeform.js
    • CivilCraft
    64-bit
  • Convex hull of the plan points

    The outline used as the object's footprint on the plan.

    keep a turn when (a − o) × (b − o) > 0

    Freeform mesh objects: quantities and placement on the ground landscape/freeform.js
    • CivilCraft
    64-bit
  • Mesh millimeters to project coordinates

    Places a mesh point on the site: scaled to project units, turned by the object's rotation and moved to its insertion point.

    x = x₀ + (x·cos a − y·sin a) × k; k = 1 ÷ (1000 × meters per project unit)

    Freeform mesh objects: quantities and placement on the ground landscape/freeform.js
    • CivilCraft
    64-bit
  • Base elevation and volume below ground

    The elevation the object's base sits at, its points in project coordinates, and an estimate of how much of it is below the existing ground.

    follow: base = lowest ground sample; cut: base = typed level or mean of the samples; below ≈ Σ (ground − base) × cell²

    Freeform mesh objects: quantities and placement on the ground landscape/freeform.js
    • CivilCraft
    64-bit
  • Scale a symbol into the unit circle

    Centers the symbol's entities and scales them so the farthest point is at radius 1.

    x′ = round((x − cx) ÷ R × 10⁴) ÷ 10⁴

    Plant symbols from SVG files and CAD blocks landscape/symbols.js
    • CivilCraft
    64-bit
  • SVG path to polylines

    Reads an SVG path's commands into straight-line polylines.

    Bézier point at t = k ÷ 8, k = 1 … 8

    Plant symbols from SVG files and CAD blocks landscape/symbols.js
    • CivilCraft
    64-bit
  • Scale a symbol to a plant

    The symbol's entities at the plant's radius on the plan.

    x = x′ × R

    Plant symbols from SVG files and CAD blocks landscape/symbols.js
    • CivilCraft
    64-bit
  • Corner elevations of a sloped platform

    The elevation of each corner of a platform that falls at a given percent in a given direction.

    z = z₀ − (pct ÷ 100) × ((x − cx)·cos a + (y − cy)·sin a)

    Landscape grading: platforms, swales, slope classes and ponding landscape/grade.js
    • CivilCraft
    64-bit
  • Mean ground elevation under an outline

    The level used for a platform, berm or paving when none is typed.

    mean of ground elevations at every vertex and edge midpoint

    Landscape grading: platforms, swales, slope classes and ponding landscape/grade.js
    • CivilCraft
    64-bit
  • Swale sections along a line

    The bottom elevations and the left and right daylight lines of a swale, as a patch of the proposed surface.

    z bottom = z start − depth − (fall ÷ 100) × s, or ground − depth, never rising; step = max(0.5 m or 1.5 ft, min(L ÷ 200, max(bottom, 1 m or 3 ft)))

    Landscape grading: platforms, swales, slope classes and ponding landscape/grade.js
    • CivilCraft
    64-bit
  • Edge of a free grading area

    The outline of a grading area with ground elevations, plus the spot elevations and contours inside it.

    edge spacing = √|area| ÷ 20

    Landscape grading: platforms, swales, slope classes and ponding landscape/grade.js
    • CivilCraft
    64-bit
  • Triangles and area by slope class

    Sorts the surface's triangles into slope bands and totals the plan area in each.

    class = number of limits the slope exceeds; area = |(b − a) × (d − a)| ÷ 2

    Landscape grading: platforms, swales, slope classes and ponding landscape/grade.js
    • CivilCraft
    64-bit
  • Ponds: depth, area and volume

    Where water would stand on the surface, and each pond's depth, area, volume and spill level.

    W(v) = max(Z(v), lowest level reached from the edge); volume = Σ triangle area × mean depth of its 3 corners

    Landscape grading: platforms, swales, slope classes and ponding landscape/grade.js
    • CivilCraft
    64-bit
  • Length along a line

    The plan length of a path, wall, curb or ramp line, and the point and direction at any distance along it.

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

    Hardscape: paving, paths, walls, ramps and steps landscape/hardscape.js
    • CivilCraft
    64-bit
  • Stations along a line

    The distances along a line where the ground is read and sections are built.

    0, step, 2·step, … , L, and every bend; each rounded to 6 decimals

    Hardscape: paving, paths, walls, ramps and steps landscape/hardscape.js
    • CivilCraft
    64-bit
  • Paving levels and falls

    The elevation of each corner of a paved area for a level surface, a cross fall, or a fall to a drain.

    drain: z = z₀ + (pct ÷ 100) × distance to the drain; cross: the platform plane

    Hardscape: paving, paths, walls, ramps and steps landscape/hardscape.js
    • CivilCraft
    64-bit
  • Path edges and steepest grade

    The center line and edges of a path on the ground, its length, and the steepest grade along it.

    grade = |Δz| ÷ Δs × 100 between stations; edge z = ground ± (crossfall ÷ 100) × width ÷ 2

    Hardscape: paving, paths, walls, ramps and steps landscape/hardscape.js
    • CivilCraft
    64-bit
  • Wall heights, face area and volume

    The top, ground and footing level of a wall at each station, with its maximum height, face area and volume.

    footing = ⌊(ground − depth) ÷ step⌋ × step; face = Σ Δs × (hₐ + h_b) ÷ 2; volume = Σ Δs × thickness × mean(top − footing)

    Hardscape: paving, paths, walls, ramps and steps landscape/hardscape.js
    • CivilCraft
    64-bit
  • Ramp grade and landings

    A ramp's rise, the number of runs and landings, its grade and the length it needs.

    runs = ⌈rise ÷ landing interval⌉; grade = rise ÷ (L − landings × landing length) × 100; need = rise ÷ (max grade ÷ 100) + landings × landing length

    Hardscape: paving, paths, walls, ramps and steps landscape/hardscape.js
    • CivilCraft
    64-bit
  • Risers, goings and run of steps

    The number of risers, the riser height, the going and the run of a flight of outdoor steps.

    n = ⌈H ÷ riser max⌉; riser = H ÷ n; going = max(going min, comfort − 2 × riser); run = treads × going + landings × (landing − going)

    Hardscape: paving, paths, walls, ramps and steps landscape/hardscape.js
    • CivilCraft
    64-bit
  • Ground strip under a retaining wall

    The two edges of the strip under a retaining wall, with the high side held at the ground or the typed top and the low side at the foot level.

    high side = left when Σ (ground left − ground right) ≥ 0

    Hardscape: paving, paths, walls, ramps and steps landscape/hardscape.js
    • CivilCraft
    64-bit
  • Hardscape quantities for takeoff

    The areas, layer volumes and lengths of paving, paths, walls, curbs and ramps passed to TakeoffCraft.

    qty = round(v × 100) ÷ 100; layer volume = area × thickness (÷ 27 for cubic yards)

    Hardscape: paving, paths, walls, ramps and steps landscape/hardscape.js
    • CivilCraft
    64-bit
  • Number format in the file

    Turns a number into the text written to the IFC file.

    text = v.toFixed(6), trailing zeros removed

    Landscape IFC export landscape/ifc-landscape.js
    • CivilCraft
    64-bit
  • Local origin of the site

    The point subtracted from every element position so the file holds small coordinates.

    origin = round(first x ÷ 100) × 100, round(first y ÷ 100) × 100

    Landscape IFC export landscape/ifc-landscape.js
    • CivilCraft
    64-bit
  • Element position and rotation

    Each element's position relative to the site origin, in meters, and its rotation as a direction.

    p = ((x − oₓ) × k, (y − oᵧ) × k, z × k); direction = (cos rot, sin rot, 0)

    Landscape IFC export landscape/ifc-landscape.js
    • CivilCraft
    64-bit
  • Profiles and extrusions

    The circles, polygons and extrusion depths that make each element's body.

    point = (x × k, y × k); depth = max(1e-4, (z₁ − z₀) × k)

    Landscape IFC export landscape/ifc-landscape.js
    • CivilCraft
    64-bit
  • Mesh body

    A freeform object's vertices and triangles as a triangulated face set.

    vertex = (x × k, y × k, z × k), 6 decimals each

    Landscape IFC export landscape/ifc-landscape.js
    • CivilCraft
    64-bit
  • Quantity sets

    Areas, lengths and volumes converted to square meters, meters and cubic meters for the file.

    area × k²; volume × k³; length × k

    Landscape IFC export landscape/ifc-landscape.js
    • CivilCraft
    64-bit
  • Plant, bed and hedge bodies

    The simple solids and property values that stand for plants, beds and hedges in the file.

    tree: trunk r = max(0.05 m, 8% of crown radius) to 40% of height, crown above; bed height = share-weighted mean plant height

    Landscape IFC export landscape/ifc-landscape.js
    • CivilCraft
    64-bit
  • Pressure and flow unit constants

    The factors between kPa and meters of water, kPa and psi, and L/min and US gallons per minute.

    kPa per m = 9.80665; kPa per psi = 6.894757; L/min per gpm = 3.785412

    Irrigation zones: flow, pressure and coverage landscape/irrigation.js
    • CivilCraft
    64-bit
  • Pipe inside diameters

    The inside diameter of each pipe size, from its outside diameter and dimension ratio.

    ID = (OD − 2 × OD ÷ SDR) × 0.0254 m (inch sizes); ID = (OD − 2 × OD ÷ 11) ÷ 1000 m (metric)

    Irrigation zones: flow, pressure and coverage landscape/irrigation.js
    • CivilCraft
    64-bit
  • Hazen-Williams loss in one pipe

    The head loss, pressure loss and velocity for a flow in a pipe.

    hf = 10.67 × L × q^1.852 ÷ (C^1.852 × d^4.8704), q in m³/s; kPa = hf × 9.80665; v = q ÷ (π d² ÷ 4)

    Irrigation zones: flow, pressure and coverage landscape/irrigation.js
    • CivilCraft
    64-bit
  • Loss in psi per 100 ft

    The US form of the Hazen-Williams formula.

    psi per 100 ft = 4.52 × Q^1.852 ÷ (C^1.852 × d^4.87) × 100

    Irrigation zones: flow, pressure and coverage landscape/irrigation.js
    • CivilCraft
    64-bit
  • Multiple-outlet factor

    The reduction in friction loss for a pipe that discharges through N evenly spaced outlets.

    F = 1 ÷ (m + 1) + 1 ÷ (2N) + √(m − 1) ÷ (6N²)

    Irrigation zones: flow, pressure and coverage landscape/irrigation.js
    • CivilCraft
    64-bit
  • Precipitation rate

    Millimeters of water per hour from a flow spread over an area.

    mm/h = 60 × L/min ÷ m²

    Irrigation zones: flow, pressure and coverage landscape/irrigation.js
    • CivilCraft
    64-bit
  • Precipitation rate, US form

    Inches of water per hour from gallons per minute over square feet.

    in/h = 96.3 × gpm ÷ ft²

    Irrigation zones: flow, pressure and coverage landscape/irrigation.js
    • CivilCraft
    64-bit
  • Flow of one head

    The flow of a sprinkler head, from its own listed flow or from its design precipitation rate.

    L/min = pr × r² × (arc ÷ 360) ÷ 60

    Irrigation zones: flow, pressure and coverage landscape/irrigation.js
    • CivilCraft
    64-bit
  • Precipitation rate at a head spacing

    The precipitation rate of heads of one type set out on a square or triangular grid.

    area = s² (square) or 0.866 × s² (triangular)

    Irrigation zones: flow, pressure and coverage landscape/irrigation.js
    • CivilCraft
    64-bit
  • Joining pipe ends into nodes

    Decides which pipe ends, heads and drip lines meet at the same point.

    same node when distance ≤ join tolerance ÷ meters per project unit

    Irrigation zones: flow, pressure and coverage landscape/irrigation.js
    • CivilCraft
    64-bit
  • Flow of a drip line

    The flow of a drip line from its length, emitter spacing and emitter rate.

    L/min = (⌊length ÷ spacing⌋ + 1) × (L/h per emitter ÷ 60)

    Irrigation zones: flow, pressure and coverage landscape/irrigation.js
    • CivilCraft
    64-bit
  • Pressure needed at the valve

    The loss from the valve to every head and the pressure the worst head needs.

    loss to node = loss to parent + friction kPa + (z node − z parent) × 9.80665; need = max(head nominal pressure + loss) + valve loss

    Irrigation zones: flow, pressure and coverage landscape/irrigation.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.