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

  • 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
  • Sleeper placement axes

    The three axes of each sleeper from its direction across the track and the cross slope.

    A₁ = (across_x, across_y, slope) ÷ |…|; A₂ = (−across_y, across_x, 0); A₃ = A₁ × A₂

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

    A pipe as a circle swept from the upstream to the downstream invert.

    L₃ = hypot(Δx, Δy, Δz); axis = Δ ÷ L₃; start z = invert + D ÷ 2

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

    The weight of each rail from its length and section.

    weight = length × um × kg per meter

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    64-bit
  • Design speed in meters per second

    Converts a design speed in km/h or mph for the road design property.

    m/s = km/h ÷ 3.6; m/s = mph × 0.44704

    IFC export: numbers written to the file ifc-civil.js
    • CivilCraft
    Exact
  • Building mass footprint and height

    The footprint area, height and gross floor area written for each building mass.

    footprint = |Σ (x_i·y_j − x_j·y_i)| ÷ 2; height = floors × floor height

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

    The factor that turns a length in the file into a length in the project.

    k = file unit in meters ÷ (1 or 1200 ÷ 3937)

    IFC import: alignments, surfaces and units ifc-civil-read.js
    • CivilCraft
    64-bit
  • File coordinates to project coordinates

    Moves a point through the file's map conversion, or adds the file's stored origin, and scales it to project units.

    p′ = (M · p) × k or p′ = (p + origin) × k

    IFC import: alignments, surfaces and units ifc-civil-read.js
    • CivilCraft
    64-bit
  • Where a horizontal segment ends

    The end point and end direction of a line, arc, cubic parabola or transition curve.

    arc: center = start ∓ r·(sin, −cos)(dir), end at angle a₀ + L ÷ r; transition: x = ∫cos θ(u) du, y = ∫sin θ(u) du

    IFC import: alignments, surfaces and units ifc-civil-read.js
    • CivilCraft
    64-bit
  • Crossing of two tangents

    The PI: where the tangent into a curve meets the tangent out of it.

    s = ((q − p) × v) ÷ (u × v); PI = p + u·s

    IFC import: alignments, surfaces and units ifc-civil-read.js
    • CivilCraft
    64-bit
  • Horizontal layout to PIs

    Turns a chain of lines, arcs and transitions into PIs with radius and spiral lengths.

    IFC import: alignments, surfaces and units ifc-civil-read.js
    • CivilCraft
    64-bit
  • Vertical layout to PVIs

    Turns grades and vertical curves into PVIs with station, elevation and curve length.

    curve: sta = d₀ + L ÷ 2, z = z₀ + g₀·L ÷ 2; end: z = z₀ + (g₀ + g₁) ÷ 2 × L

    IFC import: alignments, surfaces and units ifc-civil-read.js
    • CivilCraft
    64-bit
  • Horizontal segment values

    Reads a segment's start point, direction, radii and length into project units.

    length × (map scale × k); direction × angle unit + rotation

    IFC import: alignments, surfaces and units ifc-civil-read.js
    • CivilCraft
    64-bit
  • Vertical segment values

    Reads a vertical segment's start distance, length, height and gradients.

    z₀ = (height × map scale + map height) × k

    IFC import: alignments, surfaces and units ifc-civil-read.js
    • CivilCraft
    64-bit
  • IFC 4x1 vertical curves

    Reads an IFC 4x1 vertical segment and works out the end grade of a curve from its radius.

    g₁ = g₀ ± L ÷ R_v

    IFC import: alignments, surfaces and units ifc-civil-read.js
    • CivilCraft
    64-bit
  • Applied cant of a curve

    The cant of each curve from the constant-cant segment over its middle.

    E = right − left (or left − right); stored = round(E × 1000) ÷ 1000

    IFC import: alignments, surfaces and units ifc-civil-read.js
    • CivilCraft
    64-bit
  • CivilCraft's own PI and PVI tables

    Reads the PI and PVI tables CivilCraft wrote into an IFC4 or IFC2x3 file.

    IFC import: alignments, surfaces and units ifc-civil-read.js
    • CivilCraft
    64-bit
  • Element geometry into project coordinates

    Moves each mesh vertex through its placement and then into project coordinates.

    IFC import: alignments, surfaces and units ifc-civil-read.js
    • CivilCraft
    64-bit
  • Terrain corners joined into points

    Turns a terrain's separate triangles into one point list and faces.

    IFC import: alignments, surfaces and units ifc-civil-read.js
    • CivilCraft
    64-bit
  • A real number as IFC text

    Formats every number this file writes.

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

    Building masses as IFC ifc-massing.js
    • CivilCraft
    64-bit
  • US survey foot

    Meters in a US survey foot, shared with the project IFC export.

    1200 ÷ 3937

    Building masses as IFC ifc-massing.js
    • CivilCraft
    Exact
  • Latitude and longitude

    Writes an angle as degrees, minutes, seconds and millionths of a second.

    Building masses as IFC ifc-massing.js
    • CivilCraft
    64-bit
  • Footprint area

    The signed area of a mass outline; its sign sets the direction the outline is written in.

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

    Building masses as IFC ifc-massing.js
    • CivilCraft
    64-bit
  • File origin

    The origin footprints are written from: the middle of the masses rounded to 10 units, at the lowest ground floor level.

    origin = round((min + max) ÷ 20) × 10

    Building masses as IFC ifc-massing.js
    • CivilCraft
    Exact
  • Height and areas of a mass

    The height, footprint area and gross floor area written in the mass's properties.

    H = floors × floor height; footprint (m²) = A × um²; gross = A × floors × um²

    Building masses as IFC ifc-massing.js
    • CivilCraft
    64-bit
  • Simple curb return

    The circular arc joining two pavement edges at a corner: tangent points, center, arc length.

    ψ = acos(a · b); T = r ÷ tan(ψ ÷ 2); center = corner + bisector × r ÷ sin(ψ ÷ 2); length = r × |Δ|

    Road intersections, striping and signs intersection.js
    • CivilCraft
    64-bit
  • Three-center curb return

    A compound curve of three arcs (radii 2r, r, 2r by default) between two pavement edges.

    angles = share·Δ, (1 − 2·share)·Δ, share·Δ; T = p_x − p_y·cos h ÷ sin h; length = Σ chord lengths

    Road intersections, striping and signs intersection.js
    • CivilCraft
    64-bit
  • Intersection outline, area and curb length

    The closed pavement edge of an intersection, its area and the total length of its curb returns.

    corner: p_a + s·d_a = p_b + t·d_b, s = ((p_b − p_a) × d_b) ÷ (d_a × d_b); area = |shoelace(outline)|

    Road intersections, striping and signs intersection.js
    • CivilCraft
    64-bit
  • Polygon area

    The signed area of an outline.

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

    Road intersections, striping and signs intersection.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.