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
-
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.jsExact- BimCraft
- CivilCraft
-
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.jsExact- BimCraft
- CivilCraft
-
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.js64-bit- BimCraft
- CivilCraft
-
Elevation at a point
The surface elevation at an easting and northing.
z = w₁·z₁ + w₂·z₂ + w₃·z₃
Surface triangulation tin.js64-bit- BimCraft
- CivilCraft
-
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.js64-bit- BimCraft
- CivilCraft
-
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.js64-bit- BimCraft
- 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.