Skip to content

CenteredInterval ​

A ball c ± r with center-radius arithmetic -- the complex-capable sibling of Interval. Provided by @enumeratio/analytic.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageCenteredInterval!
CenteredInterval(c, r)the ball of radius r centered at c.
CenteredInterval(interval)an Interval converted to center-radius form.
Typed signatures
TypePackageApplies
(number | set<real>, real?) -> numberanalyticalways

Domain: Interval arithmetic

Details
  • Covers Add (centers add, radii add) and a scalar Multiply (the center scales by the factor, the radius by its absolute value). Subtraction runs through Add and Negate the same way Interval's does, which is why radii add under subtraction too, not cancel.
  • Does NOT round outward the way Wolfram's rigorous interval arithmetic does -- that needs a kernel to pin the rounding direction (see enumeratio/notatio#113 §2), so every example here uses exact endpoints, where there is nothing to round.
  • Two CenteredInterval operands multiplied together has no example and no simple exact rule here, so it is not handled.

Plot

Examples

Basic #

Centers add and radii add

live ↗
InCenteredInterval(1,12)+CenteredInterval(2,14)\mathrm{CenteredInterval}(1, \frac{1}{2})+\mathrm{CenteredInterval}(2, \frac{1}{4})OutCenteredInterval(3,34)\mathrm{CenteredInterval}(3, \frac{3}{4})

An exact factor scales center and radius

live ↗
In2CenteredInterval(2,12)2\mathrm{CenteredInterval}(2, \frac{1}{2})OutCenteredInterval(4,1)\mathrm{CenteredInterval}(4, 1)
Scope #

Converts an Interval to center-radius form

live ↗
InCenteredInterval(Interval(1,3))\mathrm{CenteredInterval}(\mathrm{Interval}(1, 3))OutCenteredInterval(2,1)\mathrm{CenteredInterval}(2, 1)

Radii add under subtraction too

live ↗
InCenteredInterval(5,14)−CenteredInterval(1,14)\mathrm{CenteredInterval}(5, \frac{1}{4})-\mathrm{CenteredInterval}(1, \frac{1}{4})OutCenteredInterval(4,12)\mathrm{CenteredInterval}(4, \frac{1}{2})
About
Examples4
Checked againstWolfram Language 4 differ
CrosswalkWolfram Language

See also: Interval, Around