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

  • Intersection sight distance

    The sight distance along the major road for a driver turning out of the minor road, in meters.

    ISD = 0.278 × V × (t_g + 0.5 × extra lanes)

    Road intersections, striping and signs intersection.js
    • CivilCraft
    64-bit
  • Sight triangle

    The three corners of the sight triangle from the driver's position and the two leg lengths.

    Road intersections, striping and signs intersection.js
    • CivilCraft
    64-bit
  • Obstacles in the sight triangle

    Which obstacle outlines reach into the sight triangle.

    Road intersections, striping and signs intersection.js
    • CivilCraft
    64-bit
  • Offset line

    A polyline moved sideways by a distance, with mitred corners.

    corner shift = d × min(4, 1 ÷ max(cos(half turn), 0.25)) along the mitre

    Road intersections, striping and signs intersection.js
    • CivilCraft
    64-bit
  • Part of a line between two distances

    Cuts a polyline to the stretch between two distances along it.

    Road intersections, striping and signs intersection.js
    • CivilCraft
    64-bit
  • Dash positions

    The painted lengths of a dashed line.

    dash k starts at from − phase + k × (dash + gap)

    Road intersections, striping and signs intersection.js
    • CivilCraft
    64-bit
  • Striping and its quantities

    Lays out center, lane and edge lines and totals the painted length and painted area.

    length per kind = Σ line lengths; painted area = Σ length × width

    Road intersections, striping and signs intersection.js
    • CivilCraft
    64-bit
  • Crosswalk bars

    The number and position of crosswalk bars across a road.

    count = max(1, ⌊(width + gap) ÷ (bar + gap)⌋); bar i starts at −used ÷ 2 + i × (bar + gap)

    Road intersections, striping and signs intersection.js
    • CivilCraft
    64-bit
  • Sign positions

    The plan position and facing of each sign from its station, side and offset.

    position = point at station + normal × side × offset; repeating signs every `every` from `from`

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

    Totals intersection pavement area, curb return length, striping length, painted area and sign count.

    Road intersections, striping and signs intersection.js
    • CivilCraft
    64-bit
  • A number as LandXML text

    Formats every number the export writes.

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

    LandXML export and import landxml.js
    • CivilCraft
    64-bit
  • Northing, easting and elevation

    Writes a point as northing, easting and elevation.

    LandXML export and import landxml.js
    • CivilCraft
    64-bit
  • Spiral element

    Writes a transition curve: length, radii, station, angle, total X and Y, long and short tangents, constant.

    theta (degrees) = θ × 180 ÷ π; constant = √(r × L_s)

    LandXML export and import landxml.js
    • CivilCraft
    64-bit
  • Curve element

    Writes a circular curve: radius, length, station, chord, delta, tangent, external and middle ordinate.

    delta (degrees) = Δ × 180 ÷ π

    LandXML export and import landxml.js
    • CivilCraft
    64-bit
  • Existing-ground profile

    Writes the ground line along an alignment as station and elevation pairs.

    LandXML export and import landxml.js
    • CivilCraft
    64-bit
  • Surface definition

    Writes a surface's plan area, surface area and highest and lowest elevations, then its points and faces.

    LandXML export and import landxml.js
    • CivilCraft
    64-bit
  • Pipe length and slope

    Writes each pipe's plan length and slope.

    length = hypot(Δx, Δy); slope = (invert up − invert down) ÷ length

    LandXML export and import landxml.js
    • CivilCraft
    64-bit
  • Feature-line arc from a bulge

    The center, radius, sweep and length of an arc segment of a feature line.

    k = (1 − b²) ÷ 4b; r = c(1 + b²) ÷ 4|b|; sweep = 4·atan b; L = r × |sweep|

    LandXML export and import landxml.js
    • CivilCraft
    64-bit
  • Reading numbers

    Splits a text list on spaces and commas and parses each number.

    LandXML export and import landxml.js
    • CivilCraft
    64-bit
  • Units of a file

    Decides whether the file is metric or in feet from its linear unit.

    LandXML export and import landxml.js
    • CivilCraft
    Exact
  • Alignment elements to PIs

    Turns lines, curves and spirals into PIs with radius and spiral lengths.

    PI = p₁ + d₁·a, a = ((p₂ − p₁) × d₂) ÷ (d₁ × d₂)

    LandXML export and import landxml.js
    • CivilCraft
    64-bit
  • PI of a plain curve without one

    Where the tangents at a curve's start and end meet, from its center.

    LandXML export and import landxml.js
    • CivilCraft
    64-bit
  • Curve to bulge

    The bulge of a feature-line arc from its start, center and end.

    sweep = (a₁ − a₀) mod 2π; bulge = ± tan(sweep ÷ 4)

    LandXML export and import landxml.js
    • CivilCraft
    64-bit
  • Sump depth of a structure

    The depth of a structure's sump below its lowest pipe invert.

    sump depth = max(0, lowest invert − sump elevation)

    LandXML export and import landxml.js
    • CivilCraft
    64-bit
  • Joining feature-line pieces

    Joins consecutive lines and curves of a plan feature into one line.

    LandXML export and import landxml.js
    • CivilCraft
    64-bit
  • Scaling an import to project units

    Multiplies every coordinate, elevation, station, radius and length of an import by one factor.

    LandXML export and import landxml.js
    • CivilCraft
    64-bit
  • Mass ordinate

    The running total of earth along the alignment, and the cut and fill totals.

    m_i = m_(i−1) + cut_i × factor − fill_i

    Mass-haul diagram masshaul.js
    • CivilCraft
    64-bit
  • Balance points

    The stations where the mass ordinate crosses zero.

    sta = sta_a + (sta_b − sta_a) × m_a ÷ (m_a − m_b)

    Mass-haul diagram masshaul.js
    • CivilCraft
    64-bit
  • Volume moved and average haul

    For each balanced stretch, the volume moved and the average distance it travels.

    volume = |peak| − |end level|; haul = ∫ (|m| − |end level|)⁺ d(sta) ÷ volume

    Mass-haul diagram masshaul.js
    • CivilCraft
    64-bit
  • Totals and what is left over

    Total cut, adjusted cut, fill, the end ordinate, and whether the job wastes, borrows or balances.

    balanced when |end| < 1e-6 × max(1, cut + fill)

    Mass-haul diagram masshaul.js
    • CivilCraft
    64-bit
  • CSV export

    Writes the stations, ordinates and spans as a CSV file in cubic yards or cubic meters.

    cubic yards = cubic feet ÷ 27

    Mass-haul diagram masshaul.js
    • CivilCraft
    64-bit
  • Footprint and floor area of an option

    The footprint area and gross floor area of each alternative, in square meters.

    area (m²) = |A| ÷ 10⁶; gross = area × floors

    Massing options placed on a lot massing-options.js
    • CivilCraft
    64-bit
  • Is the footprint a simple polygon

    Refuses a footprint whose edges cross.

    Massing options placed on a lot massing-options.js
    • CivilCraft
    64-bit
  • Turning and moving a footprint

    Rotates a footprint about its centroid and moves it to a position.

    x′ = t_x + (x − c_x)·cos a − (y − c_y)·sin a; y′ = t_y + (x − c_x)·sin a + (y − c_y)·cos a

    Massing options placed on a lot massing-options.js
    • CivilCraft
    64-bit
  • Placing an option in the envelope

    The position and rotation at which as much of the footprint as possible lies inside the buildable envelope.

    k = 0.001 ÷ meters per project unit; inside = area(envelope ∩ footprint) ÷ area(footprint)

    Massing options placed on a lot massing-options.js
    • CivilCraft
    64-bit
  • Option to a mass

    Makes a project mass from a placed option, with its floor height in project units.

    floor height = mm × 0.001 ÷ meters per project unit

    Massing options placed on a lot massing-options.js
    • CivilCraft
    64-bit
  • Envelope file

    Writes the buildable envelope in millimeters, turned so its longest edge lies along x.

    mm = meters per project unit × 1000; value = round(v × 10) ÷ 10

    Massing options placed on a lot massing-options.js
    • CivilCraft
    64-bit
  • Footprint area

    The signed area of a mass outline.

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

    Building mass areas, levels and base earthwork massing.js
    • CivilCraft
    64-bit
  • Gross floor area and height

    The floor area of all floors and the height of the mass.

    GFA = |A| × floors; height = floors × floor height

    Building mass areas, levels and base earthwork massing.js
    • CivilCraft
    64-bit
  • Centroid

    The center of area of the outline.

    c_x = Σ (x_i + x_j)·k_ij ÷ 6A, k_ij = x_i·y_j − x_j·y_i

    Building mass areas, levels and base earthwork massing.js
    • CivilCraft
    64-bit
  • Ground under a mass

    The lowest, highest and mean ground elevation under the footprint, and the samples used for earthwork.

    sample (i, j) at x₀ + (i + 0.5)·dx, y₀ + (j + 0.5)·dy; dA = |A| ÷ samples; mean = Σ z ÷ n

    Building mass areas, levels and base earthwork massing.js
    • CivilCraft
    64-bit
  • Ground floor level

    The level the mass is set at: the mean ground, the highest ground (podium) or the lowest (cut in).

    Building mass areas, levels and base earthwork massing.js
    • CivilCraft
    64-bit
  • Cut and fill under a mass

    The earth to remove above the ground floor level and to place below it.

    fill = Σ (z₀ − z)·dA where z < z₀; cut = Σ (z − z₀)·dA otherwise

    Building mass areas, levels and base earthwork massing.js
    • CivilCraft
    64-bit
  • Floor levels

    The elevation of each floor and its top.

    z_i = z₀ + i × floor height

    Building mass areas, levels and base earthwork massing.js
    • CivilCraft
    64-bit
  • Floors for a pulled height

    The floor count nearest to a height set by push and pull.

    floors = clamp(round(H ÷ floor height), 1, 200)

    Building mass areas, levels and base earthwork massing.js
    • CivilCraft
    Exact
  • Triangles of a footprint

    Splits a simple polygon into triangles for the pad top and the roof.

    Building mass areas, levels and base earthwork massing.js
    • CivilCraft
    64-bit
  • Mass prism mesh

    The triangles of the walls and roof of a mass.

    Building mass mesh for the 3D view massing.js
    • CivilCraft
    32-bit, display only
  • Lengths, bearings, grades and area

    Every number the Measure tool shows for a picked line or shape.

    L = hypot(Δx, Δy); bearing = atan2(Δy, Δx); grade % = Δz ÷ L × 100; L₃ = hypot(L, Δz); area = |Σ (x_i·y_j − x_j·y_i)| ÷ 2

    Measure tool measure.js
    • CivilCraft
    64-bit
  • Between two points on a profile

    The horizontal distance, height difference, straight-line distance and grade between two profile points.

    dx = |ch_b − ch_a|; dz = z_b − z_a; slope distance = hypot(dx, dz); grade % = dz ÷ dx × 100

    Measure tool measure.js
    • CivilCraft
    64-bit
  • Overall slope angle

    The overall pit slope from bench height, face angle, berm width and ramp.

    OSA = atan(H ÷ (H ÷ tan α + B + ramp × share))

    Block model, ultimate pit and mine schedule mining.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.