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

  • Where two contour segments cross

    The crossing point of two segments, or none when they are parallel or only meet at an end.

    d = (q − p) × (s − r); t = (r − p) × (s − r) ÷ d; point = p + t·(q − p)

    Ground surface from contour lines and points ground-surface.js
    • CivilCraft
    64-bit
  • Contour checks

    Lists lines with no elevation, elevations off the interval, duplicate lines and lines that cross.

    k = (z − base) ÷ interval; off the interval when |k − round(k)| > 1e-6

    Ground surface from contour lines and points ground-surface.js
    • CivilCraft
    64-bit
  • Line simplification

    Removes contour vertices that lie within a tolerance of the line through their neighbors.

    distance = |(p − a) × (b − a)| ÷ |b − a|

    Ground surface from contour lines and points ground-surface.js
    • CivilCraft
    64-bit
  • Placing by two known points

    The scale, rotation and shift that take two picked points to their real positions.

    k = |b₂ − a₂| ÷ |b − a|; rot = atan2(d₂) − atan2(d₁); x′ = k·(x cos rot − y sin rot) + t_x

    Ground surface from contour lines and points ground-surface.js
    • CivilCraft
    64-bit
  • Points inside flat triangles

    An estimated elevation at the centroid of each triangle whose three corners are on one contour.

    z = z₀ − (z_apex − z₀) ÷ h_n × (h ÷ 3), averaged over contour edges; limited to z₀ ± interval ÷ 2

    Ground surface from contour lines and points ground-surface.js
    • CivilCraft
    64-bit
  • Building the ground surface

    Thins the points when a spacing is given, triangulates with the breaklines, and repeats the flat-triangle fill-in up to three times.

    Ground surface from contour lines and points ground-surface.js
    • CivilCraft
    64-bit
  • Catchment area

    The area of a catchment polygon in acres or hectares.

    A = |Σ (x_j + x_i)(y_j − y_i)| ÷ 2; ÷ 43560 for acres, ÷ 10000 for hectares

    Storm drainage: rational method, pipe sizing and grade lines hydro.js
    • CivilCraft
    64-bit
  • Rainfall intensity

    The design rainfall intensity for a time of concentration.

    i = a ÷ (tc + b)^c

    Storm drainage: rational method, pipe sizing and grade lines hydro.js
    • CivilCraft
    64-bit
  • Manning factor and gravity

    The unit factor in Manning's equation and the acceleration of gravity used for velocity head.

    k = 1 (m) or 1.486 (ft); g = 9.81 (m) or 32.174 (ft)

    Storm drainage: rational method, pipe sizing and grade lines hydro.js
    • CivilCraft
    64-bit
  • Full-pipe capacity

    The flow and velocity of a circular pipe running full.

    Q = (k ÷ n) × A × R^(2/3) × √S; A = πD² ÷ 4; R = D ÷ 4

    Storm drainage: rational method, pipe sizing and grade lines hydro.js
    • CivilCraft
    64-bit
  • Part-full pipe section

    The flow area, wetted perimeter and top width of a circular pipe flowing to a given depth.

    θ = 2·acos(1 − 2y ÷ D); A = D² ÷ 8 × (θ − sin θ); P = Dθ ÷ 2; T = D sin(θ ÷ 2)

    Storm drainage: rational method, pipe sizing and grade lines hydro.js
    • CivilCraft
    64-bit
  • Normal depth

    The depth at which a pipe carries a given flow at its own slope.

    solve (k ÷ n) × A(y) × (A(y) ÷ P(y))^(2/3) × √S = Q for y

    Storm drainage: rational method, pipe sizing and grade lines hydro.js
    • CivilCraft
    64-bit
  • Design flow in each pipe

    Accumulates C × A downstream, takes the longest time of concentration, and gives each pipe its flow.

    Q = ΣCA × i(tc) (cfs, acres); Q = ΣCA × i(tc) ÷ 360 (m³/s, hectares); travel = L ÷ V ÷ 60

    Storm drainage: rational method, pipe sizing and grade lines hydro.js
    • CivilCraft
    64-bit
  • Pipe size

    The smallest standard diameter whose full-flow capacity is at least the design flow.

    Storm drainage: rational method, pipe sizing and grade lines hydro.js
    • CivilCraft
    64-bit
  • Hydraulic and energy grade lines

    The water level and energy level at each end of each pipe and at each structure, from the outlet upstream.

    S_f = (Q·n ÷ (k·A·R^(2/3)))²; HGL_up = max(HGL_dn + S_f·L, invert + D) when full, else invert + y_n; h_v = V² ÷ 2g; structure = HGL_up + k_j·h_v

    Storm drainage: rational method, pipe sizing and grade lines hydro.js
    • CivilCraft
    64-bit
  • Mesh with shared vertices

    Builds a triangle mesh in which points with the same coordinates become one vertex.

    IFC export: geometry and quantities gathered from the project ifc-civil-model.js
    • CivilCraft
    64-bit
  • Surface area of a mesh

    The area of a corridor part or slope, as the sum of its triangles.

    area = Σ |(b − a) × (c − a)| ÷ 2

    IFC export: geometry and quantities gathered from the project ifc-civil-model.js
    • CivilCraft
    64-bit
  • Vertical alignment segments

    Splits a design profile into constant grades and parabolic curves, clipped to the alignment, with each segment's start elevation and grades.

    IFC export: geometry and quantities gathered from the project ifc-civil-model.js
    • CivilCraft
    64-bit
  • Alignment as a 3D polyline

    Samples the centerline into points with stations and design elevations.

    step = max(length ÷ 400, 1 m or 3 ft); angle limit 1°

    IFC export: geometry and quantities gathered from the project ifc-civil-model.js
    • CivilCraft
    64-bit
  • Corridor parts and their areas

    Joins neighboring cross sections into surfaces per part and side, and measures each surface.

    area = mesh area; length = to station − from station

    IFC export: geometry and quantities gathered from the project ifc-civil-model.js
    • CivilCraft
    64-bit
  • Pavement course solids

    A closed solid for each pavement course: the part's top edges lowered straight down by the depth of the course's top and bottom.

    z = z_edge − depth; depth of a course's top = Σ thickness of the courses above

    IFC export: geometry and quantities gathered from the project ifc-civil-model.js
    • CivilCraft
    64-bit
  • Rail cross section in project units

    The outline of a rail (head, web, foot) from its section sizes in millimeters.

    k = 0.001 (m) or 0.001 ÷ 0.3048006096 (ft); head height = 0.27 h; foot height = 0.12 h

    IFC export: geometry and quantities gathered from the project ifc-civil-model.js
    • CivilCraft
    64-bit
  • Rails, sleepers and ballast

    Places the rail outline on each section turned to the track's cross slope, and sets sleepers along each track at their spacing.

    o′ = o·cos(atan s) − z·sin(atan s); z′ = o·sin(atan s) + z·cos(atan s); sleeper k at distance k × spacing

    IFC export: geometry and quantities gathered from the project ifc-civil-model.js
    • CivilCraft
    64-bit
  • Solid orientation

    Decides whether a closed mesh's triangles face outward, and flips them if not.

    V = Σ a · (b × c); flip when V < 0

    IFC export: geometry and quantities gathered from the project ifc-civil-model.js
    • CivilCraft
    64-bit
  • Retaining wall solids and volume

    A closed solid for each wall run with its length, heights, face area and volume.

    volume = face area × thickness

    IFC export: geometry and quantities gathered from the project ifc-civil-model.js
    • CivilCraft
    64-bit
  • Pad top, slopes and area

    The pad's top surface, its cut and fill slope surfaces and its plan area.

    area = |Σ (x_i·y_j − x_j·y_i)| ÷ 2

    IFC export: geometry and quantities gathered from the project ifc-civil-model.js
    • CivilCraft
    64-bit
  • Superelevation event stations

    The stations at which lane slopes are written as superelevation events.

    IFC export: geometry and quantities gathered from the project ifc-civil-model.js
    • CivilCraft
    64-bit
  • Structure floor and pipe sizes

    The floor level of a manhole or inlet and the pipe diameter and plan length written for the network.

    floor = sump level, else rim − 1.5 m or rim − 5 ft; D = size ÷ 1000 or ÷ 12; L = hypot(Δx, Δy)

    IFC export: geometry and quantities gathered from the project ifc-civil-model.js
    • CivilCraft
    64-bit
  • Parcel outline with arcs as chords

    The parcel boundary as points, with each curved course replaced by short chords.

    n = max(2, ⌈Δ ÷ (π ÷ 36)⌉); point k = center + R·(cos, sin)(a₀ + turn·Δ·k ÷ n)

    IFC export: geometry and quantities gathered from the project ifc-civil-model.js
    • CivilCraft
    64-bit
  • Assembly description text

    The road assembly written as words and numbers in the IFC properties.

    IFC export: geometry and quantities gathered from the project ifc-civil-model.js
    • CivilCraft
    64-bit
  • A real number as IFC text

    Formats every number the export writes.

    text = v.toFixed(d) with trailing zeros removed; d = 6 unless stated

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Points and directions

    Writes a Cartesian point and a direction.

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • File origin

    The local origin that coordinates are written from: the middle of the content rounded to 100 units.

    origin = round((min + max) ÷ 200) × 100

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    Exact
  • Unit factor to SI

    Meters per file unit, and the conversion of areas and volumes to square and cubic meters.

    um = 1, 0.3048 or 1200 ÷ 3937; m² = a × um²; m³ = v × um³

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    Exact
  • Conversion factor in the file

    Writes the foot's length in meters into the file's unit definition.

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Property values and quantities

    Writes lengths, areas, volumes, ratios, speeds and counts in property sets and quantity sets.

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Surface area written with a mesh

    The area of a surface, corridor part or slope in square meters.

    area = Σ |(b − a) × (c − a)| ÷ 2 × um²

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Triangle meshes

    Writes a surface or solid as a point list and triangles.

    x′ = x − origin_x, written with 6 decimals

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Site latitude and longitude

    Writes a latitude or longitude as degrees, minutes, seconds and millionths of a second.

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Map conversion

    The grid easting and northing of the file origin, and the rotation and scale of a local ground system.

    E₀ = to_x + s·(cos r·Δx − sin r·Δy); N₀ = to_y + s·(sin r·Δx + cos r·Δy)

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • PI and PVI tables as text

    Writes each alignment's PIs and PVIs into a property set, which is what CivilCraft reads back from IFC4 and IFC2x3 files.

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Continuity between horizontal segments

    Decides whether two neighboring segments are written as continuous, same direction, or same direction and curvature.

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Spiral terms

    The constants of Bloss, cosine, sine and Helmert transition curves.

    A_i = L × |a_i|^(−1/n) × sign a_i; f = L ÷ R₁ − L ÷ R₀; a₀ = L ÷ R₀

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Clothoid constant

    The constant A of a clothoid transition.

    A = L ÷ √|f| × sign f

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Cubic parabola coefficient

    The coefficient of y = x³ ÷ (6·R·Lp) for a cubic transition.

    A₃ = 1 ÷ (6 × R × Lp)

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Horizontal segment parameters

    Writes a segment's start point, start direction, radii and length.

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Vertical segment parameters and curve

    Writes each grade or vertical curve: start distance, height, gradients, and the curve as a line or a polynomial.

    C = (g₁ − g₀) ÷ (2L); line length = L ÷ cos(atan g₀); curve length = parabola length

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Length along a parabola

    The true length of a vertical curve y = A + Bx + Cx² over its horizontal length.

    F(x) = (d·√(1 + d²) + asinh d) ÷ 4C, d = B + 2Cx; length = F(L) − F(0)

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Cant axis

    The leaning axis of a cant segment from the height difference of the two rails.

    dy = 2 × half difference; dz = √(max(0, base² − dy²)); axis = (0, dy ÷ base, dz ÷ base)

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Helmert cant halves

    The two second-order spirals of a Helmert cant transition and the slope where they meet.

    slope = (L ÷ 2)² × (2·(L ÷ 2) ÷ A₂³)

    IFC export: numbers written to the file ifc-civil.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.