Interval Midpoint and Radius
Compute midpoint and radius of a finite ordered interval using overflow-resistant endpoint halving.
Description
Compute midpoint and radius of a finite ordered interval using overflow-resistant endpoint halving.
Midpoint and radius express an ordered interval by its center and half-width. This form is useful for symmetric comparisons or reconstructing bounds.
When to use this tool
Compute midpoint and radius of a finite ordered interval using overflow-resistant endpoint halving.
- Prepare the supplied start, end fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter start, end. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.midpoint, result.radius. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Require end at least start. Calculate midpoint as start/2 plus end/2 and radius as end/2 minus start/2, reducing avoidable overflow from summing full endpoints.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| start | start. | Finite number |
| end | end. | Finite number |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.midpoint | The midpoint value under the stated formula or text convention. |
| result.radius | The radius value under the stated formula or text convention. |
{
"input": {
"start": 2,
"end": 6
},
"output": {
"result": {
"midpoint": 4,
"radius": 2
}
}
} Limitations and assumptions
- No endpoint inclusion policy is supplied. Results still use finite floating-point arithmetic, and a degenerate interval has radius zero.
- Interval-array rows contain exactly two finite endpoints in start/end order, with at most 128 intervals per collection. Individual operations state when positive length, integer endpoints or explicit inclusion flags are required.
- Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
- Ordinary string lists have at most 128 entries of at most 128 code units each; numeric lists and matrices have separate bounded size checks. Nonfinite results and excessively large serialized outputs are rejected.
- Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.
Alternative or Complementary methods
Retain the endpoint convention with every result. Continuous length, integer point counts and open/closed membership differ; merge returned cells separately when a canonical minimal interval collection is required.
References
Similar or alternative tools
- Interval Affine Transform
Affine-transform interval endpoints, reorder the image bounds and retain negative-scale orientation reversal.
- Interval Clamp and Empty Audit
Audit raw clipped interval bounds and emptiness; disjoint intersections retain start>end as evidence, not a fabricated nonempty interval.