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
-
Arrays in the binary file
Writes an array of numbers into the binary USD file.
USD mesh coordinates in saved and exported files usd/usdc-write.js32-bit in part- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Reading a mesh
The points, faces and attached values of a mesh read from a USD scene.
USD mesh coordinates in saved and exported files usd/geom.js32-bit in part- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Built-in shapes as meshes
A cube, sphere, cylinder, cone, capsule or plane of a USD scene as a mesh.
ring point = (r·cos θ, r·sin θ, z), θ = 2π·j ÷ 24
USD mesh coordinates in saved and exported files usd/geom.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Matrix inverse
The inverse of the normal matrix, used for the solution and for the cofactors behind the error ellipses.
[N | I] → [I | N⁻¹] by row operations
Survey network adjustment adjust.js64-bit- CivilCraft
-
Observation equations
For each distance, direction, angle, azimuth, vector or control observation: observed minus computed, and its partial derivatives.
l = observed − computed; ∂d/∂x = Δx ÷ d; ∂az/∂x = Δy ÷ d²; ∂az/∂y = −Δx ÷ d²
Survey network adjustment adjust.js64-bit- CivilCraft
-
Gauss-Newton iteration
Builds the weighted normal equations, solves for the corrections and applies them until they are small.
N = AᵀPA; u = AᵀPl; Δx = N⁻¹u; P = 1 ÷ σ²
Survey network adjustment adjust.js64-bit- CivilCraft
-
Variance factor, redundancy and standardized residuals
The a posteriori standard deviation of unit weight, each observation's redundancy number and its standardized residual.
σ̂₀ = √(vᵀPv ÷ dof); r = 1 − w·aᵀQa; w-test = v ÷ (σ·√r)
Survey network adjustment adjust.js64-bit- CivilCraft
-
Error ellipses
The semi-axes and azimuth of each free point's confidence ellipse, and its standard deviations in x and y.
λ = (qxx + qyy ± √((qxx − qyy)² + 4qxy²)) ÷ 2; axis = k·σ̂₀·√λ; k = √(−2 ln(1 − confidence))
Survey network adjustment adjust.js64-bit- CivilCraft
-
Chi-square limits
The lower and upper limits the variance test compares vᵀPv with.
χ²(p, k) ≈ k·(1 − 2/(9k) + z·√(2/(9k)))³
Survey network adjustment adjust.js64-bit- CivilCraft
-
Critical value for the residual test
The two-sided normal critical value for the chosen significance level.
t = √(−2 ln(α/2)); z ≈ t − (c₀ + c₁t + c₂t²) ÷ (1 + d₁t + d₂t² + d₃t³)
Survey network adjustment adjust.js64-bit- CivilCraft
-
Leveling network
Adjusted heights of the free points from observed height differences, with residuals and standard deviations.
weight = 1 ÷ σ², or 1 ÷ length; h = N⁻¹u
Survey network adjustment adjust.js64-bit- CivilCraft
-
Traverse by the compass rule
Traverse coordinates, the misclosure, and each point corrected in proportion to the distance traveled.
x += d·sin(az), y += d·cos(az); correction = misclosure × (length so far ÷ perimeter); precision = perimeter ÷ misclosure
Survey network adjustment adjust.js64-bit- CivilCraft
-
Adjusted points as CSV
The export of adjusted coordinates and ellipse values, one point per line.
value written = round(v × 10⁴) ÷ 10⁴
Survey network adjustment adjust.js64-bit- CivilCraft
-
Angle to (−π, π]
Brings a direction difference into one turn, so a deflection is read the short way round.
Alignment lines and circular curves alignment.js64-bit- CivilCraft
-
Deflection, tangent lengths and curve center at a PI
The deflection angle at each PI, the tangent length of a plain curve, and for a curve with transitions the center and the two tangent lengths.
Δ = a₂ − a₁; T = R·tan(Δ/2); center from n₁·c = R + p₁, n₂·c = R + p₂; T₁ = k₁ − u₁·c, T₂ = u₂·c + k₂
Alignment lines and circular curves alignment.js64-bit- CivilCraft
-
Circular curve and its facts
The arc's center, start angle, length, external, middle ordinate and chord, and the PC and PT stations.
L = R·Δ; E = R·(1 ÷ cos(Δ/2) − 1); M = R·(1 − cos(Δ/2)); chord = 2R·sin(Δ/2)
Alignment lines and circular curves alignment.js64-bit- CivilCraft
-
Transition, curve, transition at one PI
The circular arc left between two transitions and the stations TS, SC, CS and ST.
Δc = |Δ| − θ₁ − θ₂; Lc = R·Δc
Alignment lines and circular curves alignment.js64-bit- CivilCraft
-
Point and direction at a station
The coordinates and forward direction on the alignment at a station.
line: p₀ + s·(cos dir, sin dir); arc: c + R·(cos a, sin a), a = a₀ ± s ÷ R
Alignment lines and circular curves alignment.js64-bit- CivilCraft
-
Station and offset of a point
The nearest station on the alignment to a point, and how far left or right of it the point lies.
line: s = (p − p₀)·u clamped to the element; arc: s = R × swept angle; offset = (p − foot) × direction
Alignment lines and circular curves alignment.js64-bit- CivilCraft
-
Station ticks
The points at every whole multiple of the station interval.
station = k × step, k whole
Alignment lines and circular curves alignment.js64-bit- CivilCraft
-
Clothoid point
The offsets along and across the tangent, and the turn so far, at a distance along a clothoid.
θ = l² ÷ (2·R·Ls); x = l·Σ (−1)ⁿ θ²ⁿ ÷ ((2n)!·(4n+1)); y = l·Σ (−1)ⁿ θ²ⁿ⁺¹ ÷ ((2n+1)!·(4n+3))
Transition curves and sampled alignment geometry alignment.js64-bit- CivilCraft
-
Gauss-Legendre quadrature
The integral the other transition kinds and the cubic parabola's length are computed with.
∫ f ≈ (h ÷ 2)·Σ panels Σ₈ wₖ·f(mid + (h ÷ 2)·xₖ)
Transition curves and sampled alignment geometry alignment.js64-bit- CivilCraft
-
Curvature shapes
The curvature law of each transition kind and its integral, which gives the turn angle.
κ = f(u) ÷ R; θ = Ls·F(u) ÷ R; u = l ÷ Ls
Transition curves and sampled alignment geometry alignment.js64-bit- CivilCraft
-
Length along a cubic parabola
The true length of a cubic parabola transition from its start to a distance along the tangent.
s(x) = ∫₀ˣ √(1 + (v² ÷ (2·R·Ls))²) dv
Transition curves and sampled alignment geometry alignment.js64-bit- CivilCraft
-
Cubic parabola parameter from a length
The tangent length Ls of the cubic parabola whose curve has a given length.
Transition curves and sampled alignment geometry alignment.js64-bit- CivilCraft
-
Point on a transition of any kind
The offsets and turn at a distance along a transition, for all six kinds.
x = ∫₀ˡ cos θ(s) ds; y = ∫₀ˡ sin θ(s) ds
Transition curves and sampled alignment geometry alignment.js64-bit- CivilCraft
-
Transition constants
The end offsets Xc and Yc, the shift p and the tangent offset k of a transition, and its true length.
p = Yc − R·(1 − cos θ); k = Xc − R·sin θ
Transition curves and sampled alignment geometry alignment.js64-bit- CivilCraft
-
Transition element and its long and short tangents
Places a transition on the alignment and works out its own point of intersection.
long tangent = Xc − Yc ÷ tan θ; short tangent = Yc ÷ sin θ
Transition curves and sampled alignment geometry alignment.js64-bit- CivilCraft
-
Point on a placed transition
The project coordinates and direction at a distance along a transition element.
p = p₀ + R(dir₀)·(x, ±y)
Transition curves and sampled alignment geometry alignment.js64-bit- CivilCraft
-
Nearest point on a transition
The station on a transition closest to a given point, for station and offset.
Transition curves and sampled alignment geometry alignment.js64-bit- CivilCraft
-
Alignment as a polyline
The alignment as vertices for linework and export: arcs and transitions become chords.
pieces = max(1, ⌈turn ÷ maxTurn⌉, ⌈length ÷ maxSeg⌉); default maxTurn = 0.5°
Transition curves and sampled alignment geometry alignment.js64-bit- CivilCraft
-
Transitions as straight pieces
Each transition cut into short lines so that crossings with other linework can be found; lines and arcs are kept exact.
pieces = max(4, ⌈θ ÷ 0.25°⌉)
Transition curves and sampled alignment geometry alignment.js64-bit- CivilCraft
-
Meters per drawing unit
The length of each $INSUNITS drawing unit in meters.
DWG and DXF linework into project units cad-linework.jsExact- CivilCraft
-
Drawing units to project units
The factor every imported coordinate is multiplied by.
inch, yard, mile into feet: meters ÷ 0.3048; metric into feet: meters ÷ (1200 ÷ 3937); into meters: meters ÷ 1
DWG and DXF linework into project units cad-linework.js64-bit- CivilCraft
-
Object coordinate system
The rotation from an entity's own coordinate system to world coordinates, from its extrusion direction.
Az = N ÷ |N|; Ax = (Wy or Wz) × Az, normalized; Ay = Az × Ax
DWG and DXF linework into project units cad-linework.js64-bit- CivilCraft
-
Composing transforms
The product of two 3×4 affine transforms, used for nested block references.
DWG and DXF linework into project units cad-linework.js64-bit- CivilCraft
-
Block reference placement
The transform of one block reference: base point, scale, array spacing, rotation, insertion point and extrusion.
M = parent · OCS · T(insert) · R(rotation) · T(column, row) · S(scale) · T(−base)
DWG and DXF linework into project units cad-linework.js64-bit- CivilCraft
-
Arcs and circles as vertices
Points along a circular arc, at most 5° apart.
n = max(2, ⌈sweep ÷ 5°⌉); p = c + r·(cos a, sin a)
DWG and DXF linework into project units cad-linework.js64-bit- CivilCraft
-
Polyline bulges as vertices
The arc between two polyline vertices that carry a bulge, as intermediate points.
θ = 4·atan(bulge); r = chord ÷ (2·sin(θ/2)); center = chord middle + r·cos(θ/2) along the normal
DWG and DXF linework into project units cad-linework.js64-bit- CivilCraft
-
Splines as vertices
Points along a B-spline, rational or not, sampled evenly in its parameter.
samples = min(4000, max(16, 32 × (control points − degree)))
DWG and DXF linework into project units cad-linework.js64-bit- CivilCraft
-
Splines stored as fit points only
A smooth curve through the fit points when the file gives no control points.
centripetal Catmull-Rom: knot step = √(distance between points); 8 vertices per span
DWG and DXF linework into project units cad-linework.js64-bit- CivilCraft
-
Ellipses as vertices
Points along an ellipse or elliptical arc.
minor = ratio × (N × major); p = c + major·cos s + minor·sin s
DWG and DXF linework into project units cad-linework.js64-bit- CivilCraft
-
One elevation per object, and flat objects
The ELEV attribute of an imported object, and whether its vertices keep a z at all.
DWG and DXF linework into project units cad-linework.js64-bit- CivilCraft
-
Feature lines read back from a drawing
The vertices of a feature line written earlier by CivilCraft, scaled into project units.
x, y, z × scale
DWG and DXF linework into project units cad-linework.js64-bit- CivilCraft
-
Survey point from a block's insertion point
The world position of each block reference, and of each cell of an arrayed reference, in project units.
world = OCS · insert; array cell offset rotated by the reference's rotation; × unit scale
DWG and DXF linework into project units block-points.js64-bit- CivilCraft
-
Number from attribute text
The elevation or number read from a block attribute such as EL 105.32.
DWG and DXF linework into project units block-points.js64-bit- CivilCraft
-
Elevation kept for a block point
Which elevation a point made from a block gets: the insertion z, an attribute, or none.
DWG and DXF linework into project units block-points.js64-bit- CivilCraft
-
Number from file text
A coordinate, angle, distance or height read from a field of the file.
Data collector files and polar reduction collector.js64-bit- CivilCraft
-
Dotted degrees, minutes, seconds to radians
An angle written as DDD.MMSSss, as many data collectors write it, as radians.
angle = (D + M ÷ 60 + S ÷ 3600) × π ÷ 180
Data collector files and polar reduction collector.js64-bit- CivilCraft
-
Degrees or gons to radians
A file angle in decimal degrees or gons as radians.
degrees × π ÷ 180; gons × π ÷ 200
Data collector files and polar reduction collector.js64-bit- 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.