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

  • Solid cubes from a distance grid

    Marks each cube solid or not from its corner values.

    solid when Σ₈ corner values < 0; origin = lo × h

    Voxel grid and lattice struts field/voxels.js
    • PartCraft
    64-bit
  • Lattice struts in a box

    The strut list of a lattice that fills a box.

    cells = ⌈(extent ÷ cell) − 1e-9⌉; end = corner + (i + a) × cell

    Voxel grid and lattice struts field/lattice.js
    • PartCraft
    64-bit
  • Millimeters per PDF point

    The size of one PDF point in millimeters, the base of every preset scale.

    MM_PER_PT = 25.4 ÷ 72

    Sheet scale, typed lengths and measured values units.js
    • MarkupCraft
    64-bit
  • Calibration from a preset scale

    Real millimeters per point for a scale chosen from the list, such as 1/4 inch = 1 foot or 1:100.

    mmPerPt = (25.4 ÷ 72) × ratio

    Sheet scale, typed lengths and measured values units.js
    • MarkupCraft
    64-bit
  • Calibration from two picked points

    Real millimeters per point from a distance picked on the sheet and the real length typed for it.

    mmPerPt = real length (mm) ÷ picked distance (pt)

    Sheet scale, typed lengths and measured values units.js
    • MarkupCraft
    64-bit
  • Fractions and mixed numbers

    Reads 1/2, 6 1/2 or 12.5 as a number.

    a/b → a ÷ b; n a/b → n + a ÷ b

    Sheet scale, typed lengths and measured values units.js
    • MarkupCraft
    64-bit
  • A typed length in millimeters

    Reads what a person types for a length (24'-0", 12' 6 1/2", 3.5 m, 900 mm, or a bare number in the chosen unit) as millimeters.

    mm = feet × 304.8 + inches × 25.4; metric: value × 1, 10 or 1000

    Sheet scale, typed lengths and measured values units.js
    • MarkupCraft
    64-bit
  • A typed length with arithmetic

    Reads entries such as 12'6" + 3/4" or 2*450mm as one length in millimeters.

    Sheet scale, typed lengths and measured values units.js
    • MarkupCraft
    64-bit
  • Length as text

    Writes a length in millimeters in the sheet's unit: feet and inches, feet, inches, meters or millimeters.

    ft-in: round(mm ÷ 25.4 × 16) sixteenths; ft: mm ÷ 304.8; in: mm ÷ 25.4; m: mm ÷ 1000

    Sheet scale, typed lengths and measured values units.js
    • MarkupCraft
    64-bit
  • Area as text

    Writes an area in square millimeters in the area unit that goes with the sheet's length unit.

    sq ft = mm² ÷ 92903.04; sq in = mm² ÷ 645.16; m² = mm² ÷ 1e6

    Sheet scale, typed lengths and measured values units.js
    • MarkupCraft
    64-bit
  • Area and perimeter of an outline

    The area and the perimeter of a closed outline, in points² and points.

    area = |Σ (xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ)| ÷ 2; perimeter = Σ hypot(Δx, Δy)

    Sheet scale, typed lengths and measured values units.js
    • MarkupCraft
    64-bit
  • Area measurement with cut-outs

    The area and perimeter text of an area markup: the outline less its cut-outs, in real units.

    area = (A_outline − Σ A_cut-out) × mmPerPt²; perimeter = (P_outline + Σ P_cut-out) × mmPerPt

    Sheet scale, typed lengths and measured values units.js
    • MarkupCraft
    64-bit
  • Length under a calibration

    A distance in points as a real length in the sheet's unit.

    length = points × mmPerPt

    Sheet scale, typed lengths and measured values units.js
    • MarkupCraft
    64-bit
  • Measured values of a markup

    The length, area and perimeter, count, angle or arc length listed for a markup in the Properties panel and, through valueOf, in lists, CSV and BCF.

    length = hypot(Δx, Δy) × mmPerPt; arc = r × |sweep| × mmPerPt; count = number of marks

    Sheet scale, typed lengths and measured values markupcraft.js
    • MarkupCraft
    64-bit
  • Pointer position on the paper

    The pointer's position on the sheet in the status line, in millimeters or inches of paper.

    mm = pt ÷ 72 × 25.4; in = pt ÷ 72

    Sheet scale, typed lengths and measured values markupcraft.js
    • MarkupCraft
    64-bit
  • Scale carried to a replacement sheet

    When markups are carried to a new revision of a sheet, the old sheet's calibration is given to the new one if it has none.

    |w_old − w_new| ≤ 1 pt and |h_old − h_new| ≤ 1 pt

    Sheet scale, typed lengths and measured values markupcraft.js
    • MarkupCraft
    64-bit
  • Size of a pasted area

    The size on the sheet of a copied area pasted as a picture: the same size on paper, or the same real size when both sheets have a scale.

    k = mmPerPx ÷ mmPerPt (both scaled), else ptPerPx; w = px_w × k; h = px_h × k

    Sheet scale, typed lengths and measured values markupcraft.js
    • MarkupCraft
    64-bit
  • Arc through three points

    The center, radius, start angle and signed sweep of the arc from the first point through the second to the third.

    d = 2·(aₓ(m_y − b_y) + mₓ(b_y − a_y) + bₓ(a_y − m_y)); cₓ = Σ (x² + y²)·Δy ÷ d; r = hypot(a − c)

    Arc through three points and angle measurement arcs.js
    • MarkupCraft
    64-bit
  • Arc as Bézier pieces

    The arc as cubic Bézier segments of at most 90° each, for drawing and for the saved appearance.

    n = ⌈|sweep| ÷ (π ÷ 2) − 1e-9⌉; k = (4 ÷ 3)·tan(step ÷ 4)

    Arc through three points and angle measurement arcs.js
    • MarkupCraft
    64-bit
  • Arc length

    The length of an arc markup in points.

    length = r × |sweep|

    Arc through three points and angle measurement arcs.js
    • MarkupCraft
    64-bit
  • Angle between two legs

    The angle at a vertex between the directions to two other points, from 0° to 180°.

    θ = acos((u·w) ÷ (|u|·|w|)) × 180 ÷ π

    Arc through three points and angle measurement arcs.js
    • MarkupCraft
    64-bit
  • Angle as text

    Writes the angle with a degree sign.

    round(deg × 10ᵖ) ÷ 10ᵖ, p = 1 by default

    Arc through three points and angle measurement arcs.js
    • MarkupCraft
    64-bit
  • Snap to 45°

    Moves a point onto the nearest 45° direction from the point before it, keeping its distance.

    a = round(atan2(dy, dx) ÷ (π ÷ 4)) × (π ÷ 4); p = from + (cos a, sin a) × hypot(dx, dy)

    Markup geometry while drawing and editing geom.js
    • MarkupCraft
    64-bit
  • Square from a corner

    Makes the box from a fixed corner to the pointer square.

    s = max(|dx|, |dy|); p = a + (sign dx, sign dy) × s

    Markup geometry while drawing and editing geom.js
    • MarkupCraft
    64-bit
  • Resize by a grip

    The new box or points when a grip of a markup is dragged.

    box: dragged edges = pointer; stroke: x′ = x₀ + (x − box x₀) ÷ box width × new width

    Markup geometry while drawing and editing geom.js
    • MarkupCraft
    64-bit
  • Move a markup

    Shifts a markup's points, box and cut-outs by a distance.

    x′ = x + dx; y′ = y + dy

    Markup geometry while drawing and editing geom.js
    • MarkupCraft
    64-bit
  • Simplify a freehand stroke

    Drops the points of a pen or highlighter stroke that lie within a tolerance of the line through their neighbors.

    d = |dy·pₓ − dx·p_y + bₓ·a_y − b_y·aₓ| ÷ L

    Markup geometry while drawing and editing geom.js
    • MarkupCraft
    64-bit
  • Inverse of a transform

    The inverse of a 2-D affine transform.

    det = a·d − b·c; inverse = adjugate ÷ det

    Markup geometry while drawing and editing geom.js
    • MarkupCraft
    64-bit
  • Line-up through two pairs of points

    The move, turn and uniform scale that carries two picked points on one sheet onto two picked points on another.

    s = |b| ÷ |a|; θ = atan2(b) − atan2(a); M = [s·cos θ, s·sin θ, −s·sin θ, s·cos θ, e, f]

    Markup geometry while drawing and editing geom.js
    • MarkupCraft
    64-bit
  • Next point from a typed length and angle

    Places the next point of a line or outline at a typed real length, along a typed angle or toward the pointer.

    len = mm ÷ mmPerPt; a = (deg + page turn) × π ÷ 180; p = from + (cos a, sin a) × len

    Markup geometry while drawing and editing sketch.js
    • MarkupCraft
    64-bit
  • Cleaned pen stroke to a markup

    Turns what the stroke cleaner recognized (line, circle, arc, outline) into the points or box of a line, ellipse, arc, rectangle, polyline or polygon markup.

    circle → box (c − r, c + r); arc → points at a₀, a₀ + sweep ÷ 2, a₁ on the circle

    Markup geometry while drawing and editing pen-clean.js
    • MarkupCraft
    64-bit
  • Finished freehand stroke

    What is stored when a pen or highlighter stroke is finished.

    tolerance = 0.6 ÷ zoom (points)

    Markup geometry while drawing and editing markupcraft.js
    • MarkupCraft
    64-bit
  • Align the old sheet in a comparison

    The fit of the old sheet onto the new one from two points picked on each, and the scale and turn reported for it.

    scale = hypot(M₀, M₁); turn = atan2(M₁, M₀) × 180 ÷ π

    Markup geometry while drawing and editing markupcraft.js
    • MarkupCraft
    64-bit
  • Line up a picture by two points

    The new box of a picture markup so two points on it land on two points on the sheet.

    k = √(rw·rh ÷ (W·H)) × fit scale; box = center ± (w·k ÷ 2, h·k ÷ 2)

    Markup geometry while drawing and editing markupcraft.js
    • MarkupCraft
    64-bit
  • Length measurement label

    The dimension line, its end ticks and the length text of a measure markup.

    len = hypot(bₓ − aₓ, b_y − a_y); label = len × mmPerPt, formatted

    Markup outlines and measurement labels shapes.js
    • MarkupCraft
    64-bit
  • Area measurement label

    The area and perimeter text of an area markup, placed at the outline's centroid.

    Markup outlines and measurement labels shapes.js
    • MarkupCraft
    64-bit
  • Angle measurement label

    The angle text of an angle markup and where it sits.

    label = angle at the vertex, 1 decimal; position = vertex + (r + 1.2 × font size) along the bisector

    Markup outlines and measurement labels shapes.js
    • MarkupCraft
    64-bit
  • Count total

    The running total shown beside the first mark of a count group.

    n = number of marks

    Markup outlines and measurement labels shapes.js
    • MarkupCraft
    Exact
  • Centroid of an outline

    The area centroid of a closed outline, used to place the label of an area or a named zone.

    k = xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ; cₓ = Σ (xᵢ + xᵢ₊₁)·k ÷ (3·Σ k)

    Markup outlines and measurement labels shapes.js
    • MarkupCraft
    64-bit
  • Circle-to-Bézier constant

    The control-point factor for drawing a quarter circle as one cubic Bézier.

    K = 4·(√2 − 1) ÷ 3 ≈ 0.5522847498

    Markup outlines and measurement labels shapes.js
    • MarkupCraft
    64-bit
  • Ellipse outline

    An ellipse markup's outline as four cubic Bézier curves inside its box.

    c = (p₀ + p₁) ÷ 2; r = (p₁ − p₀) ÷ 2; control offset = r × K

    Markup outlines and measurement labels shapes.js
    • MarkupCraft
    64-bit
  • Revision cloud outline

    The scalloped outline of a cloud markup round its corner points.

    n = max(1, round(edge ÷ arc)); step = edge ÷ n; bulge height = 0.6667 × step

    Markup outlines and measurement labels shapes.js
    • MarkupCraft
    64-bit
  • Signed area of an outline

    The signed shoelace area used to tell which way an outline runs.

    A = Σ (xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ) ÷ 2

    Markup outlines and measurement labels shapes.js
    • MarkupCraft
    64-bit
  • Box and cylinder

    A 20 mm cube and a 20 mm cylinder, standing on z = 0 and centered on the origin.

    S = 0.02; R = S ÷ 2; box: S × S square pulled up by S; cylinder: 32-sided polygon of radius R pulled up by S

    Beginner shapes, align and drop to ground beginner.js
    • ModelCraft
    64-bit
  • Cone

    A cone with a 32-sided base of radius R and its apex at height S.

    Beginner shapes, align and drop to ground beginner.js
    • ModelCraft
    64-bit
  • Sphere

    A sphere of radius R resting on z = 0, made of 12 rings of 24 faces.

    θ = π·i ÷ 12; φ = 2π·j ÷ 24; p = [R·sin θ·cos φ, R·sin θ·sin φ, R − R·cos θ]

    Beginner shapes, align and drop to ground beginner.js
    • ModelCraft
    64-bit
  • Roof

    A triangular prism: a triangle across x pulled along y from −R to +R.

    Beginner shapes, align and drop to ground beginner.js
    • ModelCraft
    64-bit
  • Align

    Moves each selected placement so the minimum, middle or maximum of its box on one axis meets that of the whole selection.

    target = lo, hi or (lo + hi) ÷ 2; move = target − own value; m[12 + axis] += move

    Beginner shapes, align and drop to ground beginner.js
    • ModelCraft
    64-bit
  • Drop to ground

    Moves each selected placement up or down so the bottom of its box is at z = 0.

    m[14] += −box.min.z

    Beginner shapes, align and drop to ground beginner.js
    • ModelCraft
    64-bit
  • Signed polygon area

    The signed area of a plan polygon.

    area = ½ Σ (xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ)

    Room outline and furniture placement furnish-mc.js
    • ModelCraft
    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.