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.
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
-
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.js64-bit- CivilCraft
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.