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

  • Regular polygon

    The corners of a regular polygon inscribed in or drawn round a circle.

    R = r (inscribed) or r ÷ cos(π ÷ n) (circumscribed); pᵢ = center + R·(cos, sin)(a₀ + i·2π ÷ n)

    Shapes made by the draw commands commands.js
    • CadCraft
    64-bit
  • Ellipse from an axis and a half-width

    The center, major-axis vector and axis ratio of an ellipse.

    ratio = half-width ÷ L, kept in 10⁻⁶…1; if half-width d > L: major = d·(−m_y, mₓ) ÷ L, ratio = L ÷ d

    Shapes made by the draw commands commands.js
    • CadCraft
    64-bit
  • Construction line at an angle

    The direction of a construction line given by a typed angle, alone or measured from a picked straight object.

    direction = (cos a, sin a); with a reference: a = atan2(u_y, uₓ) + typed angle

    Shapes made by the draw commands commands.js
    • CadCraft
    64-bit
  • Construction line that bisects an angle

    The direction of the line through a vertex that halves the angle between two legs.

    b = unit(u₀ + u₁), u₀, u₁ the unit vectors of the legs

    Shapes made by the draw commands commands.js
    • CadCraft
    64-bit
  • Construction line parallel at a distance

    The point and direction of a construction line parallel to a picked straight object.

    foot(q) = on + ((q − on)·u)·u; new point = foot(pick) + d·n, n = unit(side − foot(side))

    Shapes made by the draw commands commands.js
    • CadCraft
    64-bit
  • Lines of single-line text

    Where each further line of TEXT is placed below the first.

    line k at start + k × 1.667 × h, at right angles to the text direction

    Shapes made by the draw commands commands.js
    • CadCraft
    64-bit
  • Paragraph text box

    The box between two picked corners, measured along the text's own direction, and the width and insertion point stored from it.

    lx = d·u; ly = d·n, u = (cos rot, sin rot), n = (−sin rot, cos rot)

    Shapes made by the draw commands commands.js
    • CadCraft
    64-bit
  • Move or copy through a transform

    Applies one transform to the selected objects, replacing them or adding copies.

    Move, rotate, scale, mirror, array, stretch and lengthen commands.js
    • CadCraft
    64-bit
  • Displacement for MOVE and COPY

    The translation from a base point to a second point, or a typed displacement.

    M = T(p − base)

    Move, rotate, scale, mirror, array, stretch and lengthen commands.js
    • CadCraft
    64-bit
  • Rotate and scale about a base point

    The transform for ROTATE and SCALE.

    M = T(base) · R(a) · T(−base); M = T(base) · S(s) · T(−base)

    Move, rotate, scale, mirror, array, stretch and lengthen commands.js
    • CadCraft
    64-bit
  • Mirror across a line

    The transform that mirrors the selection across the line through two picked points.

    M = T(a) · [cos 2θ, sin 2θ; sin 2θ, −cos 2θ] · T(−a), θ = atan2(b − a)

    Move, rotate, scale, mirror, array, stretch and lengthen commands.js
    • CadCraft
    64-bit
  • Copies of a rectangular or polar array

    The copies an array makes, in rows and columns or round a center.

    rectangular: T(k·dx, r·dy); polar: step = fill ÷ items (full circle) or fill ÷ (items − 1); copy i = rotation by step × i about the center

    Move, rotate, scale, mirror, array, stretch and lengthen commands.js
    • CadCraft
    64-bit
  • Which points a stretch moves

    Whether a point lies inside one of the crossing windows that define a stretch.

    minX − 10⁻⁹ ≤ x ≤ maxX + 10⁻⁹ and minY − 10⁻⁹ ≤ y ≤ maxY + 10⁻⁹

    Move, rotate, scale, mirror, array, stretch and lengthen commands.js
    • CadCraft
    64-bit
  • Length change for LENGTHEN

    How much an object's end moves for the delta, percent, total and dynamic options.

    percent: Δ = L × (p ÷ 100 − 1); total: Δ = total − L; total angle: Δθ = angle − sweep; dynamic: Δ = ((cursor − A)·(B − A)) ÷ |B − A| − |B − A|

    Move, rotate, scale, mirror, array, stretch and lengthen commands.js
    • CadCraft
    64-bit
  • Nearest position on a line or arc

    The position (0 at the start, 1 at the end) of the point on a line or arc nearest a given point.

    line: t = clamp(((q − p₁)·(p₂ − p₁)) ÷ |p₂ − p₁|², 0, 1); arc: t = (angle from the start) ÷ sweep

    Move, rotate, scale, mirror, array, stretch and lengthen commands.js
    • CadCraft
    64-bit
  • Point on an object nearest a pick

    Where a break point or a pick lands on a line, arc, circle or polyline.

    Move, rotate, scale, mirror, array, stretch and lengthen commands.js
    • CadCraft
    64-bit
  • Offset distance through a point

    The distance OFFSET uses: the typed one, or the distance from the object to a picked point.

    through: d = min over the primitives of |p − nearest point on the primitive|

    Move, rotate, scale, mirror, array, stretch and lengthen commands.js
    • CadCraft
    64-bit
  • Distance, Δx, Δy and angle between two points

    What DIST prints for two picked points.

    d = √(Δx² + Δy²); angle = atan2(Δy, Δx), normalized to 0…360°

    Distance, area, angle and point inquiries commands.js
    • CadCraft
    64-bit
  • Area and perimeter of picked points

    The area and perimeter of the outline through points picked one by one.

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

    Distance, area, angle and point inquiries commands.js
    • CadCraft
    64-bit
  • Area and perimeter of an object

    What AREA prints for a picked circle, polyline, ellipse or hatch.

    Distance, area, angle and point inquiries commands.js
    • CadCraft
    64-bit
  • Running area total

    The total AREA keeps while areas are added and subtracted.

    total = Σ ± areaᵢ

    Distance, area, angle and point inquiries commands.js
    • CadCraft
    64-bit
  • angle = |atan2(b − v) − atan2(a − v)|, folded to 0…180°; arc: its sweep, with 0 read as 360°

    Distance, area, angle and point inquiries commands.js
    • CadCraft
    64-bit
  • Coordinates of a point

    What ID prints for a picked point.

    Distance, area, angle and point inquiries commands.js
    • CadCraft
    64-bit
  • One object in a line of text

    The description LIST prints and assistants read for an object: its points, length, radius and angles.

    line length = √(Δx² + Δy²); angles in degrees = radians × 180 ÷ π

    Distance, area, angle and point inquiries commands.js
    • CadCraft
    64-bit
  • Units of exported points

    The factor between drawing units and the units of the point file EXPORTPOINTS writes.

    factor = mm per unit ÷ 1000 (meters), ÷ 304.8 (feet), or 1 (drawing units)

    Distance, area, angle and point inquiries commands.js
    • CadCraft
    64-bit
  • Two origins of a linear dimension

    The two points a linear or aligned dimension measures between: picked, or the ends of a picked object.

    arc end = center + r·(cos a, sin a); circle: (cx − r, cy) and (cx + r, cy)

    Where dimensions are attached commands.js
    • CadCraft
    64-bit
  • Horizontal or vertical

    Whether a linear dimension measures along the X or the Y axis, from where its line is placed.

    Where dimensions are attached commands.js
    • CadCraft
    64-bit
  • Point on the circle for a radius or diameter

    The point on an arc or circle that a radius or diameter dimension is attached to.

    p₁ = center + r·(cos, sin)(atan2(cursor − center))

    Where dimensions are attached commands.js
    • CadCraft
    64-bit
  • Are two lines parallel

    Whether two picked lines have an angle between them that can be dimensioned.

    parallel when |e × f| < 10⁻¹² × |e| × |f|

    Where dimensions are attached commands.js
    • CadCraft
    64-bit
  • Continued and baseline dimensions

    The origins and line position of each dimension added by DIMCONTINUE or DIMBASELINE.

    baseline: loc = previous loc + dli × scale × side × (−sin rot, cos rot), dli defaults to 3.75

    Where dimensions are attached commands.js
    • CadCraft
    64-bit
  • Origin and X axis from two points

    The coordinate system with its origin at a picked point and its X axis toward a second point.

    origin = o; angle = atan2(pₓ − o) (ucs.js threePoint)

    User coordinate system set by command commands.js
    • CadCraft
    64-bit
  • Rotation about Z

    The coordinate system turned by a typed angle about its own origin.

    angle = current angle + a (a defaults to π ÷ 2)

    User coordinate system set by command commands.js
    • CadCraft
    64-bit
  • Quarter turn

    The coordinate system turned a quarter left or right, or set back to the world.

    angle = current angle ± π ÷ 2

    User coordinate system set by command commands.js
    • CadCraft
    64-bit
  • What UCS prints

    The origin and angle of the coordinate system as printed in the command history.

    angle shown = (angle mod 2π) × 180 ÷ π, at most 4 decimals

    User coordinate system set by command commands.js
    • CadCraft
    64-bit
  • Viewport from two corners

    The size and center of a new viewport, and what it shows.

    w = |Δx|; h = |Δy|; center = (a + b) ÷ 2

    Viewports on a sheet commands.js
    • CadCraft
    64-bit
  • Scale that fits a named view

    The viewport scale at which a saved view of the model fills the viewport.

    s = min(viewport w ÷ view w, viewport h ÷ view h)

    Viewports on a sheet commands.js
    • CadCraft
    64-bit
  • Volume printed after a 3D command

    The total volume of the solids a command just made, in drawing units cubed.

    V = Σ volumeᵢ ÷ (k × k × k)

    3D solid commands: sizes, paths and reported volume commands3d.js
    • CadCraft
    64-bit
  • Number text in 3D command messages

    How heights, radii, angles and volumes are written on the command line.

    |n| < 1e-10 → 0; otherwise n rounded to 4 decimals

    3D solid commands: sizes, paths and reported volume commands3d.js
    • CadCraft
    64-bit
  • Sweep path from a 2D object

    The points a profile is swept along, taken from a line, polyline, arc, circle or ellipse.

    n = max(2, ⌈sweep ÷ (π ÷ 24)⌉); pᵢ = c + r × (cos aᵢ, sin aᵢ), aᵢ = a₀ ± sweep × i ÷ n

    3D solid commands: sizes, paths and reported volume commands3d.js
    • CadCraft
    64-bit
  • Extrude: outline, height and taper to model units

    Converts the picked outline and the typed height and taper angle into the numbers the solid is made from.

    ring = (x × k, y × k); height = h × k; taper = degrees × π ÷ 180

    3D solid commands: sizes, paths and reported volume commands3d.js
    • CadCraft
    64-bit
  • Revolve angle

    The angle a profile is turned through; no angle means a full turn.

    θ = 2π if |angle| < 1e-9, else angle

    3D solid commands: sizes, paths and reported volume commands3d.js
    • CadCraft
    64-bit
  • 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

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.