tolerance.explicit
A tolerance the caller chose, clamped into the usable range.
Usage
Tolerance.explicit(absolute: number, angleRad?: number): ToleranceParameters
absolutenumberDistance below which two things count as coincident. Required. Range [0, 1.7976931348623157e+308] model.
angleRadnumberAngle below which two directions count as parallel; the default is one degree (π / 180). Default
DEFAULT_ANGLE_TOLERANCE_RAD. Range [0, 1.5707963267948966] radians.
Returns
A tolerance with source: 'explicit'. A non-finite or non-positive absolute becomes 0 (exact coincidence only); a non-finite angle becomes the default, and a finite one is clamped to [0, π/2].
Guarantees
- absolute is finite and ≥ 0 (Number.isFinite(t.absolute) && t.absolute >= 0)
- angleRad is in [0, π/2] (t.angleRad >= 0 && t.angleRad <= Math.PI / 2)
- t.source === 'explicit'
Use instead
tolerance.resolve: inside an operation that accepts an optional tolerance argument
Example
Tolerance.explicit(0.01) // → { absolute: 0.01, angleRad: 0.0174…, source: 'explicit' }
Tolerance.explicit(-1, 9) // → { absolute: 0, angleRad: 1.5707…, source: 'explicit' }