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

  • Which side of an edge

    Whether three points turn counter-clockwise, clockwise, or lie on one line.

    sign of (b − a) × (c − a)

    Surface triangulation tin.js
    • BimCraft
    • CivilCraft
    Exact
  • Is an edge Delaunay

    Whether the point across an edge lies inside the circle through the triangle on this side.

    sign of the in-circle determinant of a, b, c, d

    Surface triangulation tin.js
    • BimCraft
    • CivilCraft
    Exact
  • Triangle under a point

    The triangle a point falls in and its three barycentric weights.

    w₁ = ((y_b − y_c)(x − x_c) + (x_c − x_b)(y − y_c)) ÷ d, w₃ = 1 − w₁ − w₂

    Surface triangulation tin.js
    • BimCraft
    • CivilCraft
    64-bit
  • Elevation at a point

    The surface elevation at an easting and northing.

    z = w₁·z₁ + w₂·z₂ + w₃·z₃

    Surface triangulation tin.js
    • BimCraft
    • CivilCraft
    64-bit
  • Slope of a triangle

    Rise over run and the downhill direction of one triangle.

    n = u × v; slope = √((n_x ÷ n_z)² + (n_y ÷ n_z)²)

    Surface triangulation tin.js
    • BimCraft
    • CivilCraft
    64-bit
  • Plan and surface area

    The surface's area in plan and along the slope, with its elevation range.

    area in plan = Σ |n_z| ÷ 2; surface area = Σ |u × v| ÷ 2

    Surface triangulation tin.js
    • BimCraft
    • 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.