Skip to content

Main content

Periodic Interval Shorter Gap Tool

Shortest separation of two closed non-wrapping supplied intervals on one periodic domain.

Loading tool…

Description

Return the shortest gap between two closed intervals on a periodic axis.

A periodic coordinate identifies values separated by a whole cycle. Minimum-image gaps require a wrapping interval and an explicit half-cycle tie convention; signed direction and unsigned separation answer different questions.

Return the shortest gap between two closed intervals on a periodic axis.

When to use this tool

Use Periodic Interval Shorter Gap when checking one explicit periodic-coordinate or gap convention.

How to use the tool and how it works

  1. Enter firstStart, firstEnd, secondStart, secondEnd, period. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read gap. Use the output convention below.

Return the shortest gap between two closed intervals on a periodic axis. Require each ordered interval inside [0,period] and positive period; compare ordinary interval gaps at shifts zero and plus/minus period.1

Input fieldMeaning and unitsAccepted input
firstStartFirst StartRequired. Finite number; minimum 0.
firstEndFirst EndRequired. Finite number.
secondStartSecond StartRequired. Finite number; minimum 0.
secondEndSecond EndRequired. Finite number.
periodPeriodRequired. Finite number; strictly above 0.
Output fieldInterpretationReturned shape
gapGapRequired. Finite number.
json
{
  "input": {
    "firstStart": 1,
    "firstEnd": 2,
    "secondStart": 8,
    "secondEnd": 9,
    "period": 10
  },
  "output": {
    "gap": 2
  }
}

Limitations and assumptions

  • Each input interval must be nonwrapping; split a seam-crossing interval beforehand.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use a complete periodic geometry model when multiple axes, seam-crossing intervals or path winding matter.

References

  1. Calculation and input contract: distance/periodic-interval-shorter-gap — tool.io

Similar or alternative tools