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

  • Ambient occlusion of a texel

    The share of directions above a surface point that are not blocked nearby.

    open ÷ rays, directions (√u₁ cos 2πu₂, √u₁ sin 2πu₂, √(1 − u₁)) about the normal

    Material graphs baked to textures shading/texbake-job.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • Decal geometry

    The triangles under a decal, clipped to its box and lifted off the surface.

    corner = o + x u + y v + z n + 0.0005 × face normal

    Material graphs baked to textures shading/decal.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • A number as written to the file

    The text of every numeric value in the exported file.

    text = round(x × 10⁶) ÷ 10⁶

    MaterialX files: numbers written and read shading/mtlx.js
    • BimCraft
    • ModelCraft
    64-bit
  • Tile size as uvtiling

    The repeat of every texture in the file, from the material's tile size in meters.

    uvtiling = round(10⁶ ÷ size) ÷ 10⁶

    MaterialX files: numbers written and read shading/mtlx.js
    • BimCraft
    • ModelCraft
    64-bit
  • Shader parameters

    The constant inputs of the surface shader written to the file.

    Standard Surface: emission = luminance × 0.02; thin film thickness × 1000

    MaterialX files: numbers written and read shading/mtlx.js
    • BimCraft
    • ModelCraft
    64-bit
  • Displacement height range

    The lowest height and the span of the height map, which set the displacement texture's levels and the scale written to the file.

    span = max h − min h; level = round(255 (h − min h) ÷ span); scale = displacement scale × span

    MaterialX files: numbers written and read shading/mtlx.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Displacement scale written

    The scale input of the displacement shader in the exported file.

    scale = round(10⁶ × displacement scale × span) ÷ 10⁶

    MaterialX files: numbers written and read shading/mtlx.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • A value read from the file

    The number or list of numbers in a value attribute.

    MaterialX files: numbers written and read shading/mtlx.js
    • BimCraft
    • ModelCraft
    64-bit
  • Unit changes on reading

    Standard Surface values converted to the app's units.

    thin film thickness ÷ 1000; emission ÷ 0.02; opacity = (r + g + b) ÷ 3

    MaterialX files: numbers written and read shading/mtlx.js
    • BimCraft
    • ModelCraft
    64-bit
  • Tile size from uvtiling

    The material's tile size in meters from the uvtiling shared by a file's images.

    width = 1 ÷ tiling_u; height = 1 ÷ tiling_v

    MaterialX files: numbers written and read shading/mtlx.js
    • BimCraft
    • ModelCraft
    64-bit
  • Mean of an input that varies over the tile

    The single value given to a shader input the renderers and the file cannot vary across the surface.

    mean = Σ f(uᵢ, vⱼ) ÷ 64², a 64 × 64 grid of texel centers

    MaterialX files: numbers written and read shading/bake.js
    • BimCraft
    • ModelCraft
    64-bit
  • Size in millimeters

    The width and height of the copied area, on paper or at the drawing's real size.

    paper: mm = pixels × ptPerPx × (25.4 ÷ 72); real: mm = pixels × mmPerPx

    Size of a copied area areaclip.js
    • CadCraft
    • BimCraft
    • MarkupCraft
    • DetailCraft
    64-bit
  • Render size in pixels

    The pixel width and height for an area given in points at a resolution, lowered so neither side passes the cap.

    d = dpi × min(1, maxPx ÷ (longer side × dpi ÷ 72)); w = round(wPt × d ÷ 72); h = round(hPt × d ÷ 72)

    Size of a copied area areaclip.js
    • CadCraft
    • BimCraft
    • MarkupCraft
    • DetailCraft
    64-bit
  • Scale and turn from two points

    The scale, the angle and the point mapping that carry two points on the picture onto the two points where they belong.

    scale = |b₂ − b₁| ÷ |a₂ − a₁|; angle = atan2(b₂ − b₁) − atan2(a₂ − a₁); map(p) = b₁ + scale · R(angle) · (p − a₁)

    Size of a copied area areaclip.js
    • CadCraft
    • BimCraft
    • MarkupCraft
    • DetailCraft
    64-bit
  • Box round a turned picture

    The width and height of the upright box round a picture turned by an angle.

    w′ = w·|cos θ| + h·|sin θ|; h′ = w·|sin θ| + h·|cos θ|

    Size of a copied area areaclip.js
    • CadCraft
    • BimCraft
    • MarkupCraft
    • DetailCraft
    64-bit
  • Outline of an elliptical area

    The points of the ellipse that fits a box, used as the outline of a round copied area.

    pᵢ = (cx + rx·cos(2π·i ÷ n), cy + ry·sin(2π·i ÷ n)), n = 96

    Size of a copied area areaclip.js
    • CadCraft
    • BimCraft
    • MarkupCraft
    • DetailCraft
    64-bit
  • Longitude and latitude to web Mercator

    The web Mercator x and y in meters for a longitude and latitude in degrees.

    x = R·λ·π ÷ 180; y = R·ln(tan(π ÷ 4 + φ·π ÷ 360)), R = 6378137

    Map layers: web Mercator, tile grids and world files basemap.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Web Mercator to longitude and latitude

    The longitude and latitude in degrees for a web Mercator x and y in meters.

    λ = x ÷ R × 180 ÷ π; φ = (2·atan(e^(y ÷ R)) − π ÷ 2) × 180 ÷ π

    Map layers: web Mercator, tile grids and world files basemap.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Standard tile grid

    The origin and the resolution of each zoom level of the usual 256-pixel web Mercator tiles.

    origin = (−πR, πR); res(z) = 2πR ÷ 256 ÷ 2^z, z = 0…22

    Map layers: web Mercator, tile grids and world files basemap.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Tile that holds a place

    The tile column and row at a zoom level for a longitude and latitude.

    col = ⌊(x + πR) ÷ (res × 256)⌋; row = ⌊(πR − y) ÷ (res × 256)⌋

    Map layers: web Mercator, tile grids and world files basemap.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Tiles covering a box

    The tiles of a grid that cover a box, each with its bounds in the grid's units.

    bounds = [ox + c·tw, oy − (r + 1)·th, ox + (c + 1)·tw, oy − r·th], tw = res × tile width

    Map layers: web Mercator, tile grids and world files basemap.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Meters per unit of a coordinate system

    The length in meters of one degree, foot, US survey foot or meter, for turning a WMTS scale into a resolution.

    degree: 2π × 6378137 ÷ 360; foot: 0.3048; US survey foot: 1200 ÷ 3937; otherwise 1

    Map layers: web Mercator, tile grids and world files basemap.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Tile grid of a WMTS tile matrix set

    The resolution and top-left corner of each level of a WMTS tile matrix set.

    res = scale denominator × 0.00028 ÷ meters per unit

    Map layers: web Mercator, tile grids and world files basemap.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • World file to a pixel-corner transform

    The transform from pixel corners to coordinates for a picture, from the six numbers of its world file.

    x₀ = C − A ÷ 2 − B ÷ 2; y₀ = F − D ÷ 2 − E ÷ 2

    Map layers: web Mercator, tile grids and world files basemap.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Pixel to coordinates

    The coordinates of a pixel position in a picture's own system.

    x = g₀ + u·g₁ + v·g₂; y = g₃ + u·g₄ + v·g₅

    Map layers: web Mercator, tile grids and world files basemap.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Numbers in a map request

    How the corners of the requested box are written into a WMS or map-server export address.

    |v| ≥ 10,000: v.toFixed(3); otherwise v.toPrecision(12)

    Map layers: web Mercator, tile grids and world files basemap.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Affine through three points

    The affine transform that carries three source points onto three destination points.

    det = (u₁ − u₀)(v₂ − v₀) − (u₂ − u₀)(v₁ − v₀); a = ((x₁ − x₀)(v₂ − v₀) − (x₂ − x₀)(v₁ − v₀)) ÷ det

    Map pictures warped onto the plan basemap.js
    • CadCraft
    • BimCraft
    • CivilCraft
    32-bit, display only
  • Cells of a warped picture

    The cells a picture is cut into so that each can be drawn with one affine transform.

    split while max |affine(p) − exact(p)| > tol over the fourth corner, the middle and the four edge midpoints

    Map pictures warped onto the plan basemap.js
    • CadCraft
    • BimCraft
    • CivilCraft
    32-bit, display only
  • Tile level for the screen

    Which level of a tile grid is drawn at the current zoom.

    the coarsest level with res ≤ 1.5 × screen resolution

    Map pictures warped onto the plan basemap.js
    • CadCraft
    • BimCraft
    • CivilCraft
    32-bit, display only
  • Meters per unit

    The length of a meter, an international foot and a US survey foot in meters.

    m = 1; ft = 0.3048; ftUS = 1200 ÷ 3937

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    Exact
  • Local system to grid and back

    Moves a point between project (ground or assumed) coordinates and grid coordinates.

    grid = to + k × R(θ) × (p − from); p = from + R(θ)ᵀ × (grid − to) ÷ k

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Project point to longitude and latitude and back

    The longitude and latitude (WGS 84) of a project point, and the project point of a longitude and latitude.

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Grid scale factor, convergence and elevation factor

    At a project point: the grid scale factor, the meridian convergence in degrees, the elevation factor and the combined factor.

    k_N = |p(φ+d) − p(φ−d)| ÷ (2 M d); k_E = |p(λ+d) − p(λ−d)| ÷ (2 N cos φ d); k = (k_N + k_E) ÷ 2; γ = −atan2(Δx, Δy); elevation = R ÷ (R + h), R = √(M N)

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Local system from two control points

    The scale and rotation that carry two points known in both local and grid coordinates onto each other.

    scale = |B − A| ÷ |b − a|; rotation = atan2(grid) − atan2(local), in degrees, brought into −180 to 180

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Ground coordinates about a base point

    A local system that scales by a combined factor about one base point, with no rotation.

    scale = combined; rotation = 0; from = to = base

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Any system to any system

    Converts a coordinate pair from one system's definition to another's.

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Matching a .prj to a catalog system

    Decides whether the projection in a .prj file is one of the catalog's systems, and if so uses the catalog's definition.

    |a − a′| < 1e-3; |e² − e′²| < 1e-9; distance at each of 3 probe points < 1e-3 (1e-9 for geographic)

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Probe points for matching

    Three longitude and latitude points inside a projection's zone, used to compare two definitions.

    (λ₀, φ), (λ₀ + 0.5°, φ + 0.5°), (λ₀ − 0.5°, φ + 0.25°)

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Linear unit of a .prj

    Decides whether a projection is in meters, international feet or US survey feet.

    |k − 1| < 1e-12 → m; |k − 0.3048| < 1e-10 → ft; |k − 1200 ÷ 3937| < 1e-10 → ftUS

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Extent of a grid shift file

    The west, south, east and north limits, in degrees, of the area a loaded grid shift file covers.

    east = −λ_ll × 180 ÷ π; west = −(λ_ll + (n_λ − 1) × Δλ) × 180 ÷ π; north = (φ_ll + (n_φ − 1) × Δφ) × 180 ÷ π

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • UTM zone to EPSG code

    The EPSG number of a UTM zone typed as text such as UTM 33N.

    WGS 84: 32600 + zone (north), 32700 + zone (south); NAD83: 26900 + zone; ETRS89: 25800 + zone; GDA94: 28300 + zone; GDA2020: 7800 + zone

    Coordinate reference systems crs-pick-shared.js
    • CadCraft
    • BimCraft
    • CivilCraft
    Exact
  • Linear unit of a typed definition

    Decides whether a typed projection definition is in meters, international feet, US survey feet or degrees.

    |k − 1| < 1e-12 → m; |k − 0.3048| < 1e-10 → ft; |k − 1200 ÷ 3937| < 1e-10 → ftUS

    Coordinate reference systems crs-pick-shared.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Probe points for a typed definition

    Three longitude and latitude points inside the definition's zone, used to compare it with catalog systems.

    Coordinate reference systems crs-pick-shared.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Matching a typed definition to the catalog

    Finds the catalog systems that give the same easting and northing as a typed definition.

    same projection family; |a − a′| ≤ 1e-3; |e² − e′²| ≤ 1e-9; distance at each of 3 probe points < 1e-3

    Coordinate reference systems crs-pick-shared.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Round-trip check of a typed definition

    Refuses a typed projection that does not return its own probe point.

    |inverse(forward(λ, φ)) − (λ, φ)| < 1e-6 degrees in each of λ and φ

    Coordinate reference systems crs-pick-shared.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Do two systems give the same coordinates

    Says whether two systems give the same easting and northing.

    same unit and distance at each of 3 probe points < 1e-3

    Coordinate reference systems crs-pick-shared.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • A group value by its code

    Turns one group's text into a real number, a whole number, a true or false, or text.

    codes 10–59, 110–149, 210–239, 460–469, 1010–1059: parseFloat; 60–99, 160–179, 270–289, 370–389, 400–409, 420–429, 440–459, 1060–1071: parseInt

    DXF reading into the shared drawing model dxf-model.js
    • CadCraft
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    64-bit
  • Arc angles

    An arc's start and end angles in radians.

    angle = degrees × (π ÷ 180)

    DXF reading into the shared drawing model dxf-model.js
    • CadCraft
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    64-bit
  • Multi-line text direction

    The direction vector of multi-line text, from the file's vector or from its rotation angle.

    x axis = group 11 when present; otherwise (cos(a), sin(a)), a = degrees × (π ÷ 180)

    DXF reading into the shared drawing model dxf-model.js
    • CadCraft
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    64-bit
  • Hatch arc and ellipse edges

    The center, radius or axes, and start and end angles of the curved edges of a hatch boundary.

    angle = degrees × (π ÷ 180); missing end angle = 360 degrees

    DXF reading into the shared drawing model dxf-model.js
    • CadCraft
    • BimCraft
    • TakeoffCraft
    • 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.